]> git.proxmox.com Git - rustc.git/blame - src/test/ui/underscore-imports/hygiene-2.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / underscore-imports / hygiene-2.rs
CommitLineData
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
8mod x {
9 pub use std::ops::Deref as _;
10}
11
12macro n() {
13 pub use crate::x::*;
14}
15
16#[macro_export]
17macro_rules! p {
18 () => { pub use crate::x::*; }
19}
20
21macro 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
28m!(y);
29
30fn main() {
31 use crate::y::*;
6a06907d 32 #[allow(noop_method_call)]
e74abb32
XL
33 (&()).deref();
34}