From 974f1eff58d01ce0bb5583adf0066a84d8eed812 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 14 Apr 2016 01:20:22 +0000 Subject: [PATCH] Add test for issue #31856 --- src/test/compile-fail/issue-32922.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/compile-fail/issue-32922.rs b/src/test/compile-fail/issue-32922.rs index fdf5cbfd3c4..4206b16a419 100644 --- a/src/test/compile-fail/issue-32922.rs +++ b/src/test/compile-fail/issue-32922.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(rustc_attrs)] +#![allow(warnings)] macro_rules! foo { () => { let x = 1; @@ -16,5 +17,15 @@ macro_rules! foo { () => { let _ = bar!(); }} +macro_rules! bar { // test issue #31856 + ($n:ident) => ( + let a = 1; + let $n = a; + ) +} + #[rustc_error] -fn main() { foo! {}; } //~ ERROR compilation successful +fn main() { //~ ERROR compilation successful + foo! {}; + bar! {}; +}