From 09fbf386d7669c939e9e64038efd21cc182c2f5b Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 13 May 2019 22:19:19 +0100 Subject: [PATCH] Update tests --- src/test/ui/obsolete-in-place/bad.bad.stderr | 23 ++++++++++---------- src/test/ui/obsolete-in-place/bad.rs | 14 +++--------- src/test/ui/obsolete-in-place/bad.stderr | 8 +++++++ src/test/ui/parser/if-in-in.stderr | 3 --- src/test/ui/placement-syntax.rs | 5 +++-- src/test/ui/placement-syntax.stderr | 14 ------------ 6 files changed, 26 insertions(+), 41 deletions(-) create mode 100644 src/test/ui/obsolete-in-place/bad.stderr delete mode 100644 src/test/ui/placement-syntax.stderr diff --git a/src/test/ui/obsolete-in-place/bad.bad.stderr b/src/test/ui/obsolete-in-place/bad.bad.stderr index 468577ab168c7..d895981050ae9 100644 --- a/src/test/ui/obsolete-in-place/bad.bad.stderr +++ b/src/test/ui/obsolete-in-place/bad.bad.stderr @@ -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 - -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 + = 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`. diff --git a/src/test/ui/obsolete-in-place/bad.rs b/src/test/ui/obsolete-in-place/bad.rs index f35d297e552ee..805c54d865da5 100644 --- a/src/test/ui/obsolete-in-place/bad.rs +++ b/src/test/ui/obsolete-in-place/bad.rs @@ -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` } diff --git a/src/test/ui/obsolete-in-place/bad.stderr b/src/test/ui/obsolete-in-place/bad.stderr new file mode 100644 index 0000000000000..81d8ecf0fe743 --- /dev/null +++ b/src/test/ui/obsolete-in-place/bad.stderr @@ -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 + diff --git a/src/test/ui/parser/if-in-in.stderr b/src/test/ui/parser/if-in-in.stderr index 9926fcc0858e5..1adb4429ec7d0 100644 --- a/src/test/ui/parser/if-in-in.stderr +++ b/src/test/ui/parser/if-in-in.stderr @@ -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 error: aborting due to previous error diff --git a/src/test/ui/placement-syntax.rs b/src/test/ui/placement-syntax.rs index ac6fed1558f53..7d0a4df6ec1d0 100644 --- a/src/test/ui/placement-syntax.rs +++ b/src/test/ui/placement-syntax.rs @@ -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"); } } diff --git a/src/test/ui/placement-syntax.stderr b/src/test/ui/placement-syntax.stderr deleted file mode 100644 index 350aaa9bdddc1..0000000000000 --- a/src/test/ui/placement-syntax.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: emplacement syntax is obsolete (for now, anyway) - --> $DIR/placement-syntax.rs:3:8 - | -LL | if x<-1 { - | ^^^^ - | - = note: for more information, see -help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` - | -LL | if x< -1 { - | ^^^ - -error: aborting due to previous error -