From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/obsolete-in-place/bad.rs | 11 +++++++++++ src/test/ui/obsolete-in-place/bad.stderr | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/test/ui/obsolete-in-place/bad.rs create mode 100644 src/test/ui/obsolete-in-place/bad.stderr (limited to 'src/test/ui/obsolete-in-place') diff --git a/src/test/ui/obsolete-in-place/bad.rs b/src/test/ui/obsolete-in-place/bad.rs new file mode 100644 index 000000000..a491bb21a --- /dev/null +++ b/src/test/ui/obsolete-in-place/bad.rs @@ -0,0 +1,11 @@ +// Check that `<-` and `in` syntax gets a hard error. + +fn foo() { + let (x, y) = (0, 0); + x <- y; //~ ERROR unexpected token: `<-` +} + +fn main() { + let (foo, bar) = (0, 0); + 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 000000000..363dfb776 --- /dev/null +++ b/src/test/ui/obsolete-in-place/bad.stderr @@ -0,0 +1,19 @@ +error: unexpected token: `<-` + --> $DIR/bad.rs:5:7 + | +LL | x <- y; + | ^^ + | +help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` + | +LL | x < - y; + | ~~~ + +error: expected expression, found keyword `in` + --> $DIR/bad.rs:10:5 + | +LL | in(foo) { bar }; + | ^^ expected expression + +error: aborting due to 2 previous errors + -- cgit v1.2.3