2017-03-11 04:58:19 -06:00
|
|
|
// aux-build:two_macros.rs
|
|
|
|
|
|
|
|
mod foo {
|
|
|
|
extern crate two_macros;
|
|
|
|
pub use self::two_macros::m as panic;
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m1 {
|
|
|
|
use foo::panic; // ok
|
|
|
|
fn f() { panic!(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m2 {
|
2017-12-10 14:29:24 -06:00
|
|
|
use foo::*;
|
2017-03-11 04:58:19 -06:00
|
|
|
fn f() { panic!(); } //~ ERROR ambiguous
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m3 {
|
2017-12-10 14:29:24 -06:00
|
|
|
::two_macros::m!(use foo::panic;);
|
2017-03-11 04:58:19 -06:00
|
|
|
fn f() { panic!(); } //~ ERROR ambiguous
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m4 {
|
|
|
|
macro_rules! panic { () => {} } // ok
|
|
|
|
panic!();
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m5 {
|
|
|
|
macro_rules! m { () => {
|
2018-08-17 18:38:51 -05:00
|
|
|
macro_rules! panic { () => {} }
|
2017-03-11 04:58:19 -06:00
|
|
|
} }
|
2017-12-10 14:29:24 -06:00
|
|
|
m!();
|
2018-08-17 18:38:51 -05:00
|
|
|
panic!(); //~ ERROR `panic` is ambiguous
|
2017-03-11 04:58:19 -06:00
|
|
|
}
|
|
|
|
|
2017-12-10 14:29:24 -06:00
|
|
|
#[macro_use(n)]
|
2017-03-11 04:58:19 -06:00
|
|
|
extern crate two_macros;
|
|
|
|
mod bar {
|
|
|
|
pub use two_macros::m as n;
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m6 {
|
|
|
|
use bar::n; // ok
|
|
|
|
n!();
|
|
|
|
}
|
|
|
|
|
|
|
|
mod m7 {
|
2017-12-10 14:29:24 -06:00
|
|
|
use bar::*;
|
2017-03-11 04:58:19 -06:00
|
|
|
n!(); //~ ERROR ambiguous
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|