rust/tests/ui/dollar-crate/dollar-crate-is-keyword.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
544 B
Rust
Raw Normal View History

2017-06-25 17:34:49 +00:00
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`
}
2017-06-25 17:34:49 +00:00
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
2017-06-25 17:34:49 +00:00
}
}
m!();
fn main() {}