Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 18, 2019
1 parent b842b34 commit 09fbf38
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 41 deletions.
23 changes: 12 additions & 11 deletions src/test/ui/obsolete-in-place/bad.bad.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
error: emplacement syntax is obsolete (for now, anyway)
--> $DIR/bad.rs:9:5
|
LL | x <- y;
| ^^^^^^
|
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>

error: emplacement syntax is obsolete (for now, anyway)
error: expected expression, found keyword `in`
--> $DIR/bad.rs:10:5
|
LL | in(foo) { bar };
| ^^^^^^^^^^^^^^^
| ^^ expected expression

error[E0282]: type annotations needed
--> $DIR/bad.rs:9:8
|
LL | let (x, y, foo, bar);
| ---------------- consider giving the pattern a type
LL | x <- y;
| ^^^ cannot infer type
|
= note: for more information, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
= note: type must be known at this point

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0282`.
14 changes: 3 additions & 11 deletions src/test/ui/obsolete-in-place/bad.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
// Check that `<-` and `in` syntax gets a hard error.

// revisions: good bad
//[good] run-pass

#[cfg(bad)]
fn main() {
let (x, y, foo, bar);
x <- y; //[bad]~ ERROR emplacement syntax is obsolete
in(foo) { bar }; //[bad]~ ERROR emplacement syntax is obsolete
}

#[cfg(good)]
fn main() {
let (x, y, foo, bar) = (0, 0, 0, 0);
x <- y; // ok: parses as a comparison
in(foo) { bar }; //~ERROR expected expression, found keyword `in`
}
8 changes: 8 additions & 0 deletions src/test/ui/obsolete-in-place/bad.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected expression, found keyword `in`
--> $DIR/bad.rs:6:5
|
LL | in(foo) { bar };
| ^^ expected expression

error: aborting due to previous error

3 changes: 0 additions & 3 deletions src/test/ui/parser/if-in-in.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ LL | for i in in 1..2 {
| ---^^
| |
| help: remove the duplicated `in`
|
= note: if you meant to use emplacement syntax, it is obsolete (for now, anyway)
= note: for more information on the status of emplacement syntax, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>

error: aborting due to previous error

5 changes: 3 additions & 2 deletions src/test/ui/placement-syntax.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// run-pass

fn main() {
let x = -5;
if x<-1 {
//~^ ERROR emplacement syntax is obsolete
if x<-1 { // ok: parses as a comparison
println!("ok");
}
}
14 changes: 0 additions & 14 deletions src/test/ui/placement-syntax.stderr

This file was deleted.

0 comments on commit 09fbf38

Please sign in to comment.