summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hygiene/lexical.rs
blob: 3d25c720989bf51a2f40f82063d9e0fd1c456ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// check-pass
// ignore-pretty pretty-printing is unhygienic

#![feature(decl_macro)]

mod bar {
    mod baz {
        pub fn f() {}
    }

    pub macro m($f:ident) {
        baz::f();
        let _: i32 = $f();
        {
            fn $f() -> u32 { 0 }
            let _: u32 = $f();
        }
    }
}

fn main() {
    fn f() -> i32 { 0 }
    bar::m!(f);
}