]> git.proxmox.com Git - rustc.git/blob - src/test/ui/macros/pub-macro-rules.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / macros / pub-macro-rules.rs
1 // check-pass
2
3 #![feature(pub_macro_rules)]
4
5 mod m {
6 // `pub` `macro_rules` can be used earlier in item order than they are defined.
7 foo!();
8
9 pub macro_rules! foo { () => {} }
10
11 // `pub(...)` works too.
12 pub(super) macro_rules! bar { () => {} }
13 }
14
15 // `pub` `macro_rules` are available by module path.
16 m::foo!();
17
18 m::bar!();
19
20 fn main() {}