error[E0133]: use of mutable static is unsafe and requires unsafe function or block
--> src/main.rs:4:20
|
4 | println!("{}", ::nameof::name_of!(TEST));
| ^^^^^^^^^^^^^^^^^^^^^^^^ use of mutable static
|
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
= note: this error originates in the macro `::nameof::name_of` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0133`.
error: could not compile `bug-repro-rust-nameof-unsafe` due to previous error
Given this code:
the compiler fails with this error: