summaryrefslogtreecommitdiffstats
path: root/src/test/ui/obsolete-in-place
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/obsolete-in-place')
-rw-r--r--src/test/ui/obsolete-in-place/bad.rs11
-rw-r--r--src/test/ui/obsolete-in-place/bad.stderr19
2 files changed, 30 insertions, 0 deletions
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
+