rust/tests/ui/imports/macros.rs

42 lines
634 B
Rust
Raw Normal View History

2016-11-12 09:38:12 +00:00
// aux-build:two_macros.rs
extern crate two_macros; // two identity macros `m` and `n`
mod foo {
pub use two_macros::n as m;
}
mod m1 {
m!(use two_macros::*;);
use foo::m; // This shadows the glob import
}
mod m2 {
use two_macros::*;
2016-11-12 09:38:12 +00:00
m! { //~ ERROR ambiguous
use foo::m;
2016-11-12 09:38:12 +00:00
}
}
mod m3 {
use two_macros::m;
2016-11-12 09:38:12 +00:00
fn f() {
use two_macros::n as m; // This shadows the above import
m!();
}
fn g() {
m! { //~ ERROR ambiguous
use two_macros::n as m;
2016-11-12 09:38:12 +00:00
}
}
}
mod m4 {
macro_rules! m { () => {} }
use two_macros::m;
m!();
2016-11-12 09:38:12 +00:00
}
fn main() {}