]> git.lizzy.rs Git - rust.git/blob - src/test/ui/underscore-imports/macro-expanded.rs
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
[rust.git] / src / test / ui / underscore-imports / macro-expanded.rs
1 // Check that macro expanded underscore imports behave as expected
2
3 // check-pass
4
5 #![feature(decl_macro, rustc_attrs)]
6
7 mod x {
8     pub use std::ops::Not as _;
9 }
10
11 macro m() {
12     mod w {
13         mod y {
14             pub use std::ops::Deref as _;
15         }
16         use crate::x::*;
17         use self::y::*;
18         use std::ops::DerefMut as _;
19         fn f() {
20             false.not();
21             (&()).deref();
22             (&mut ()).deref_mut();
23         }
24     }
25 }
26
27 #[rustc_macro_transparency = "transparent"]
28 macro n() {
29     mod z {
30         pub use std::ops::Deref as _;
31     }
32     use crate::x::*;
33     use crate::z::*;
34     use std::ops::DerefMut as _;
35     fn f() {
36         false.not();
37         (&()).deref();
38         (&mut ()).deref_mut();
39     }
40 }
41
42 m!();
43 n!();
44
45 fn main() {}