]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-path-prelude-shadowing.rs
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / ui / macros / macro-path-prelude-shadowing.rs
1 // aux-build:macro-in-other-crate.rs
2
3 #![feature(decl_macro)]
4
5 macro_rules! add_macro_expanded_things_to_macro_prelude {() => {
6     #[macro_use]
7     extern crate macro_in_other_crate;
8 }}
9
10 add_macro_expanded_things_to_macro_prelude!();
11
12 mod m1 {
13     fn check() {
14         inline!(); // OK. Theoretically ambiguous, but we do not consider built-in attributes
15                    // as candidates for non-attribute macro invocations to avoid regressions
16                    // on stable channel
17     }
18 }
19
20 mod m2 {
21     pub mod std {
22         pub macro panic() {}
23     }
24 }
25
26 mod m3 {
27     use m2::*; // glob-import user-defined `std`
28     fn check() {
29         std::panic!(); //~ ERROR `std` is ambiguous
30     }
31 }
32
33 fn main() {}