about summary refs log tree commit diff
path: root/src/test/ui/macros/pub-macro-rules.rs
blob: cd4a845f7c07dd3cc8bd6a834612b36772980566 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// check-pass

#![feature(pub_macro_rules)]

mod m {
    // `pub` `macro_rules` can be used earlier in item order than they are defined.
    foo!();

    pub macro_rules! foo { () => {} }

    // `pub(...)` works too.
    pub(super) macro_rules! bar { () => {} }
}

// `pub` `macro_rules` are available by module path.
m::foo!();

m::bar!();

fn main() {}