]> git.lizzy.rs Git - rust.git/blob - tests/ui/dollar-crate/dollar-crate-is-keyword.rs
Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, r=davidtwco
[rust.git] / tests / ui / dollar-crate / dollar-crate-is-keyword.rs
1 macro_rules! m {
2     () => {
3         // Avoid having more than one `$crate`-named item in the same module,
4         // as even though they error, they still parse as `$crate` and conflict.
5         mod foo {
6             struct $crate {} //~ ERROR expected identifier, found reserved identifier `$crate`
7         }
8
9         use $crate; //~ ERROR `$crate` may not be imported
10         use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate`
11         //~^ ERROR `$crate` may not be imported
12     }
13 }
14
15 m!();
16
17 fn main() {}