summaryrefslogtreecommitdiffstats
path: root/tests/ui/obsolete-in-place
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/obsolete-in-place
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/obsolete-in-place')
-rw-r--r--tests/ui/obsolete-in-place/bad.rs11
-rw-r--r--tests/ui/obsolete-in-place/bad.stderr19
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/obsolete-in-place/bad.rs b/tests/ui/obsolete-in-place/bad.rs
new file mode 100644
index 000000000..a491bb21a
--- /dev/null
+++ b/tests/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/tests/ui/obsolete-in-place/bad.stderr b/tests/ui/obsolete-in-place/bad.stderr
new file mode 100644
index 000000000..363dfb776
--- /dev/null
+++ b/tests/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
+