diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-12 04:24:51 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-12 06:28:37 +0000 |
| commit | 236b67af5197fc76206d402cab99cd0af2bff090 (patch) | |
| tree | 26c667e133f2359b96c25bccdfcde1353b3f29f7 | |
| parent | 2d1f3009ccd5ddbf6ec36f7005f7e742ae923a7d (diff) | |
| download | rust-236b67af5197fc76206d402cab99cd0af2bff090.tar.gz rust-236b67af5197fc76206d402cab99cd0af2bff090.zip | |
Add regression test
| -rw-r--r-- | src/test/compile-fail/macro-use-scope.rs (renamed from src/test/compile-fail-fulldeps/expanded-macro-use.rs) | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/test/compile-fail-fulldeps/expanded-macro-use.rs b/src/test/compile-fail/macro-use-scope.rs index 98ed3e7145b..5256396a242 100644 --- a/src/test/compile-fail-fulldeps/expanded-macro-use.rs +++ b/src/test/compile-fail/macro-use-scope.rs @@ -8,12 +8,25 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_private)] -macro_rules! m { - () => { #[macro_use] extern crate syntax; } +// aux-build:two_macros.rs + +#![feature(rustc_attrs)] +#![allow(unused)] + +fn f() { + let _ = macro_one!(); } +#[macro_use(macro_one)] // Check that this macro is usable in the above function +extern crate two_macros; + +macro_rules! m { () => { + fn g() { + macro_two!(); + } + #[macro_use(macro_two)] // Check that this macro is usable in the above function + extern crate two_macros as _two_macros; +} } m!(); -fn main() { - help!(); //~ ERROR unexpected end of macro invocation -} +#[rustc_error] +fn main() {} //~ ERROR compilation successful |
