mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
18 lines
544 B
Rust
18 lines
544 B
Rust
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() {}
|