]>
Commit | Line | Data |
---|---|---|
e74abb32 XL |
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::*; | |
6a06907d | 32 | #[allow(noop_method_call)] |
e74abb32 XL |
33 | (&()).deref(); |
34 | } |