Skip to content

Commit 36f6542

Browse files
committed
Update tests
1 parent 7948b68 commit 36f6542

File tree

6 files changed

+51
-34
lines changed

6 files changed

+51
-34
lines changed
+12-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
error: emplacement syntax is obsolete (for now, anyway)
2-
--> $DIR/bad.rs:9:5
3-
|
4-
LL | x <- y;
5-
| ^^^^^^
6-
|
7-
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
8-
9-
error: emplacement syntax is obsolete (for now, anyway)
1+
error: expected expression, found keyword `in`
102
--> $DIR/bad.rs:10:5
113
|
124
LL | in(foo) { bar };
13-
| ^^^^^^^^^^^^^^^
5+
| ^^ expected expression
6+
7+
error[E0282]: type annotations needed
8+
--> $DIR/bad.rs:9:8
9+
|
10+
LL | let (x, y, foo, bar);
11+
| ---------------- consider giving the pattern a type
12+
LL | x <- y;
13+
| ^^^ cannot infer type
1414
|
15-
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
15+
= note: type must be known at this point
1616

1717
error: aborting due to 2 previous errors
1818

19+
For more information about this error, try `rustc --explain E0282`.

src/test/ui/obsolete-in-place/bad.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
// Check that `<-` and `in` syntax gets a hard error.
22

3-
// revisions: good bad
4-
//[good] run-pass
5-
6-
#[cfg(bad)]
7-
fn main() {
8-
let (x, y, foo, bar);
9-
x <- y; //[bad]~ ERROR emplacement syntax is obsolete
10-
in(foo) { bar }; //[bad]~ ERROR emplacement syntax is obsolete
3+
fn foo() {
4+
let (x, y) = (0, 0);
5+
x <- y; //~ ERROR expected one of
6+
//~^ ERROR mismatched types
117
}
128

13-
#[cfg(good)]
149
fn main() {
10+
let (foo, bar) = (0, 0);
11+
in(foo) { bar }; //~ ERROR expected expression, found keyword `in`
1512
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `<-`
2+
--> $DIR/bad.rs:5:7
3+
|
4+
LL | x <- y;
5+
| ^^ expected one of 8 possible tokens here
6+
7+
error: expected expression, found keyword `in`
8+
--> $DIR/bad.rs:11:5
9+
|
10+
LL | in(foo) { bar };
11+
| ^^ expected expression
12+
13+
error[E0308]: mismatched types
14+
--> $DIR/bad.rs:5:5
15+
|
16+
LL | fn foo() {
17+
| - possibly return type missing here?
18+
LL | let (x, y) = (0, 0);
19+
LL | x <- y;
20+
| ^ expected (), found integer
21+
|
22+
= note: expected type `()`
23+
found type `{integer}`
24+
25+
error: aborting due to 3 previous errors
26+
27+
For more information about this error, try `rustc --explain E0308`.

src/test/ui/parser/if-in-in.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ LL | for i in in 1..2 {
55
| ---^^
66
| |
77
| help: remove the duplicated `in`
8-
|
9-
= note: if you meant to use emplacement syntax, it is obsolete (for now, anyway)
10-
= note: for more information on the status of emplacement syntax, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
118

129
error: aborting due to previous error
1310

src/test/ui/placement-syntax.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
fn main() {
22
let x = -5;
3-
if x<-1 {
4-
//~^ ERROR emplacement syntax is obsolete
3+
if x<-1 { //~ ERROR expected `{`, found `<-`
54
println!("ok");
65
}
76
}

src/test/ui/placement-syntax.stderr

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
error: emplacement syntax is obsolete (for now, anyway)
2-
--> $DIR/placement-syntax.rs:3:8
1+
error: expected `{`, found `<-`
2+
--> $DIR/placement-syntax.rs:3:9
33
|
44
LL | if x<-1 {
5-
| ^^^^
6-
|
7-
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
8-
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
9-
|
10-
LL | if x< -1 {
11-
| ^^^
5+
| -- ^^ expected `{`
6+
| |
7+
| this `if` statement has a condition, but no block
128

139
error: aborting due to previous error
1410

0 commit comments

Comments
 (0)