rust/tests/ui/crate_in_macro_def.fixed
2022-03-24 05:08:10 -04:00

30 lines
541 B
Rust

// run-rustfix
#![warn(clippy::crate_in_macro_def)]
#[macro_use]
mod hygienic {
macro_rules! print_message_hygienic {
() => {
println!("{}", $crate::hygienic::MESSAGE);
};
}
pub const MESSAGE: &str = "Hello!";
}
#[macro_use]
mod unhygienic {
macro_rules! print_message_unhygienic {
() => {
println!("{}", $crate::unhygienic::MESSAGE);
};
}
pub const MESSAGE: &str = "Hello!";
}
fn main() {
print_message_hygienic!();
print_message_unhygienic!();
}