]> git.lizzy.rs Git - rust.git/blob - tests/ui/underscore-imports/hygiene-2.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / ui / underscore-imports / hygiene-2.rs
1 // Make sure that underscore imports with different contexts can exist in the
2 // same scope.
3
4 // check-pass
5
6 #![feature(decl_macro)]
7
8 mod x {
9     pub use std::ops::Deref as _;
10 }
11
12 macro n() {
13     pub use crate::x::*;
14 }
15
16 #[macro_export]
17 macro_rules! p {
18     () => { pub use crate::x::*; }
19 }
20
21 macro m($y:ident) {
22     mod $y {
23         crate::n!(); // Reexport of `Deref` should not be imported in `main`
24         crate::p!(); // Reexport of `Deref` should be imported into `main`
25     }
26 }
27
28 m!(y);
29
30 fn main() {
31     use crate::y::*;
32     #[allow(noop_method_call)]
33     (&()).deref();
34 }