rust/tests/ui/imports/macros.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
634 B
Rust
Raw Normal View History

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 {
use two_macros::*;
2016-11-12 03:38:12 -06:00
m! { //~ ERROR ambiguous
use foo::m;
2016-11-12 03:38:12 -06:00
}
}
mod m3 {
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
use two_macros::n as m;
2016-11-12 03:38:12 -06:00
}
}
}
mod m4 {
macro_rules! m { () => {} }
use two_macros::m;
m!();
2016-11-12 03:38:12 -06:00
}
fn main() {}