summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-15189.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-15189.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-15189.rs b/src/test/ui/issues/issue-15189.rs
new file mode 100644
index 000000000..a9c884bdc
--- /dev/null
+++ b/src/test/ui/issues/issue-15189.rs
@@ -0,0 +1,10 @@
+// run-pass
+macro_rules! third {
+ ($e:expr) => ({let x = 2; $e[x]})
+}
+
+fn main() {
+ let x = vec![10_usize,11_usize,12_usize,13_usize];
+ let t = third!(x);
+ assert_eq!(t,12_usize);
+}