summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dollar-crate/dollar-crate-is-keyword.rs
blob: d625163dc7e1cec64a4599024c9b710caaa18bc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
macro_rules! m {
    () => {
        // Avoid having more than one `$crate`-named item in the same module,
        // as even though they error, they still parse as `$crate` and conflict.
        mod foo {
            struct $crate {} //~ ERROR expected identifier, found reserved identifier `$crate`
        }

        use $crate; //~ ERROR `$crate` may not be imported
        use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate`
        //~^ ERROR `$crate` may not be imported
    }
}

m!();

fn main() {}