Open
Description
In a macro that takes a path as an argument:
macro_rules! get_msg {
($module:path) => {
let message = {
use $module::{MESSAGE}; // note the (usually unnecessary) brackets
MESSAGE
};
println!("{}", message);
};
}
The braces around MESSAGE
are required, and the code fails to compile without them. However, rustfmt removes them.
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ca5ee49a37c35354f67d82d6303c7f5a