summaryrefslogtreecommitdiffstats
path: root/src/test/ui/match/expr_before_ident_pat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/match/expr_before_ident_pat.rs')
-rw-r--r--src/test/ui/match/expr_before_ident_pat.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/match/expr_before_ident_pat.rs b/src/test/ui/match/expr_before_ident_pat.rs
new file mode 100644
index 000000000..47db6c3f4
--- /dev/null
+++ b/src/test/ui/match/expr_before_ident_pat.rs
@@ -0,0 +1,15 @@
+#![feature(half_open_range_patterns)]
+
+macro_rules! funny {
+ ($a:expr, $b:ident) => {
+ match [1, 2] {
+ [$a, $b] => {}
+ }
+ };
+}
+
+fn main() {
+ funny!(a, a);
+ //~^ ERROR cannot find value `a` in this scope
+ //~| ERROR arbitrary expressions aren't allowed in patterns
+}