summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hygiene/lambda-var-hygiene.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/hygiene/lambda-var-hygiene.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/hygiene/lambda-var-hygiene.rs b/src/test/ui/hygiene/lambda-var-hygiene.rs
new file mode 100644
index 000000000..bf06765e5
--- /dev/null
+++ b/src/test/ui/hygiene/lambda-var-hygiene.rs
@@ -0,0 +1,12 @@
+// run-pass
+// shouldn't affect evaluation of $ex:
+macro_rules! bad_macro {
+ ($ex:expr) => ({(|_x| { $ex }) (9) })
+}
+
+fn takes_x(_x : isize) {
+ assert_eq!(bad_macro!(_x),8);
+}
+fn main() {
+ takes_x(8);
+}