diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-01-19 15:49:30 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-01-20 08:35:46 -0800 |
| commit | bef5ff1121edf2b75c6ae0d8eb2277bea94686b9 (patch) | |
| tree | 915b62d21cb995b2780170509eac6c80481921bc /src/test | |
| parent | 0c7117457dbefa93468f8fb1a85eba75f32e2865 (diff) | |
| parent | c02d577c53dc29fcef0c589af8d95d037777a09b (diff) | |
| download | rust-bef5ff1121edf2b75c6ae0d8eb2277bea94686b9.tar.gz rust-bef5ff1121edf2b75c6ae0d8eb2277bea94686b9.zip | |
Rollup merge of #39077 - jseyfried:crate_var_imports, r=nrc
Improve the warning cycle for `use $crate;` Fixes #39049. r? @nrc
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/auxiliary/import_crate_var.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/import-crate-var.rs | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/test/compile-fail/auxiliary/import_crate_var.rs b/src/test/compile-fail/auxiliary/import_crate_var.rs index 1dfc7a128aa..a8a55afa41a 100644 --- a/src/test/compile-fail/auxiliary/import_crate_var.rs +++ b/src/test/compile-fail/auxiliary/import_crate_var.rs @@ -8,5 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +pub fn f() {} + #[macro_export] -macro_rules! m { () => { use $crate; } } +macro_rules! m { () => { + use $crate; + import_crate_var::f(); +} } diff --git a/src/test/compile-fail/import-crate-var.rs b/src/test/compile-fail/import-crate-var.rs index 9f573945483..e58ba2c8891 100644 --- a/src/test/compile-fail/import-crate-var.rs +++ b/src/test/compile-fail/import-crate-var.rs @@ -11,11 +11,13 @@ // aux-build:import_crate_var.rs // error-pattern: `$crate` may not be imported // error-pattern: `use $crate;` was erroneously allowed and will become a hard error +// error-pattern: compilation successful #![feature(rustc_attrs)] #[macro_use] extern crate import_crate_var; -m!(); #[rustc_error] -fn main() {} +fn main() { + m!(); +} |
