diff options
Diffstat (limited to 'tests/ui/imports/glob-shadowing.rs')
-rw-r--r-- | tests/ui/imports/glob-shadowing.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/imports/glob-shadowing.rs b/tests/ui/imports/glob-shadowing.rs new file mode 100644 index 000000000..3a33b592b --- /dev/null +++ b/tests/ui/imports/glob-shadowing.rs @@ -0,0 +1,34 @@ +#![feature(decl_macro)] + +mod m { + pub macro env($e: expr) { $e } + pub macro fenv() { 0 } +} + +mod glob_in_normal_module { + use m::*; + fn check() { + let x = env!("PATH"); //~ ERROR `env` is ambiguous + } +} + +mod glob_in_block_module { + fn block() { + use m::*; + fn check() { + let x = env!("PATH"); //~ ERROR `env` is ambiguous + } + } +} + +mod glob_shadows_item { + pub macro fenv($e: expr) { $e } + fn block() { + use m::*; + fn check() { + let x = fenv!(); //~ ERROR `fenv` is ambiguous + } + } +} + +fn main() {} |