2017-06-25 12:34:49 -05:00
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
2018-08-09 08:29:22 -05:00
|
|
|
// 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 12:34:49 -05:00
|
|
|
|
2020-01-02 04:03:04 -06:00
|
|
|
use $crate; //~ ERROR `$crate` may not be imported
|
2017-06-29 05:16:35 -05:00
|
|
|
use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate`
|
2020-01-03 03:50:12 -06:00
|
|
|
//~^ ERROR `$crate` may not be imported
|
2017-06-25 12:34:49 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m!();
|
|
|
|
|
|
|
|
fn main() {}
|