2016-11-12 03:38:12 -06: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 14:29:24 -06:00
|
|
|
use two_macros::*;
|
2016-11-12 03:38:12 -06:00
|
|
|
m! { //~ ERROR ambiguous
|
2017-12-10 14:29:24 -06:00
|
|
|
use foo::m;
|
2016-11-12 03:38:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m3 {
|
2017-12-10 14:29:24 -06:00
|
|
|
use two_macros::m;
|
2016-11-12 03:38:12 -06:00
|
|
|
fn f() {
|
|
|
|
use two_macros::n as m; // This shadows the above import
|
|
|
|
m!();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn g() {
|
|
|
|
m! { //~ ERROR ambiguous
|
2017-12-10 14:29:24 -06:00
|
|
|
use two_macros::n as m;
|
2016-11-12 03:38:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m4 {
|
2017-12-10 14:29:24 -06:00
|
|
|
macro_rules! m { () => {} }
|
|
|
|
use two_macros::m;
|
2018-09-26 20:49:40 -05:00
|
|
|
m!();
|
2016-11-12 03:38:12 -06:00
|
|
|
}
|
2018-03-12 15:21:43 -05:00
|
|
|
|
|
|
|
fn main() {}
|