]> git.lizzy.rs Git - rust.git/blob - src/test/ui/imports/local-modularized-tricky-pass-2.rs
Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'
[rust.git] / src / test / ui / imports / local-modularized-tricky-pass-2.rs
1 // check-pass
2 //
3 // `#[macro_export] macro_rules` that doesn't originate from macro expansions can be placed
4 // into the root module soon enough to act as usual items and shadow globs and preludes.
5
6 #![feature(decl_macro)]
7
8 // `macro_export` shadows globs
9 use inner1::*;
10
11 mod inner1 {
12     pub macro exported() {}
13 }
14
15 exported!();
16
17 mod deep {
18     fn deep() {
19         type Deeper = [u8; {
20             #[macro_export]
21             macro_rules! exported {
22                 () => ( struct Б; )
23             }
24
25             0
26         }];
27     }
28 }
29
30 // `macro_export` shadows std prelude
31 fn main() {
32     panic!();
33 }
34
35 mod inner3 {
36     #[macro_export]
37     macro_rules! panic {
38         () => ( struct Г; )
39     }
40 }
41
42 // `macro_export` shadows builtin macros
43 include!();
44
45 mod inner4 {
46     #[macro_export]
47     macro_rules! include {
48         () => ( struct Д; )
49     }
50 }