about summary refs log tree commit diff
path: root/src/test/ui/parser/intersection-patterns.stderr
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-14 16:57:18 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-10-14 17:08:13 +0200
commita77a8aaa2e55c0591ee766f3ff2142a67439d243 (patch)
tree033fc0f822e96a2cfb6b7313da43988cdfd69178 /src/test/ui/parser/intersection-patterns.stderr
parent29fb07d2451035cce7fbe99bc854cb3d71b5f1a1 (diff)
downloadrust-a77a8aaa2e55c0591ee766f3ff2142a67439d243.tar.gz
rust-a77a8aaa2e55c0591ee766f3ff2142a67439d243.zip
syntax: add test for intersection pattern parser recovery
Diffstat (limited to 'src/test/ui/parser/intersection-patterns.stderr')
-rw-r--r--src/test/ui/parser/intersection-patterns.stderr33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/ui/parser/intersection-patterns.stderr b/src/test/ui/parser/intersection-patterns.stderr
new file mode 100644
index 00000000000..03781f8fdee
--- /dev/null
+++ b/src/test/ui/parser/intersection-patterns.stderr
@@ -0,0 +1,33 @@
+error: pattern on wrong side of `@`
+  --> $DIR/intersection-patterns.rs:13:9
+   |
+LL |         Some(x) @ y => {}
+   |         -------^^^-
+   |         |         |
+   |         |         binding on the right, should be to the left
+   |         pattern on the left, should be to the right
+   |         help: switch the order: `y@Some(x)`
+
+error: left-hand side of `@` must be a binding pattern
+  --> $DIR/intersection-patterns.rs:23:9
+   |
+LL |         Some(x) @ Some(y) => {}
+   |         -------^^^-------
+   |         |         |
+   |         |         also a pattern
+   |         interpreted as a pattern, not a binding
+   |
+   = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
+
+error: pattern on wrong side of `@`
+  --> $DIR/intersection-patterns.rs:32:9
+   |
+LL |         1 ..= 5 @ e => {}
+   |         -------^^^-
+   |         |         |
+   |         |         binding on the right, should be to the left
+   |         pattern on the left, should be to the right
+   |         help: switch the order: `e@1 ..=5`
+
+error: aborting due to 3 previous errors
+