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 {
|
2017-12-10 20:29:24 +00:00
|
|
|
use two_macros::*;
|
2016-11-12 09:38:12 +00:00
|
|
|
m! { //~ ERROR ambiguous
|
2017-12-10 20:29:24 +00:00
|
|
|
use foo::m;
|
2016-11-12 09:38:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m3 {
|
2017-12-10 20:29:24 +00:00
|
|
|
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
|
2017-12-10 20:29:24 +00:00
|
|
|
use two_macros::n as m;
|
2016-11-12 09:38:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m4 {
|
2017-12-10 20:29:24 +00:00
|
|
|
macro_rules! m { () => {} }
|
|
|
|
use two_macros::m;
|
2018-09-27 01:49:40 +00:00
|
|
|
m!();
|
2016-11-12 09:38:12 +00:00
|
|
|
}
|
2018-03-12 20:21:43 +00:00
|
|
|
|
|
|
|
fn main() {}
|