rust/tests/ui/statics/issue-15261.rs
Obei Sideg 408eeae59d Improve wording of static_mut_ref
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18 06:01:40 +03:00

13 lines
273 B
Rust

//@ build-pass
#![allow(dead_code)]
#![allow(non_upper_case_globals)]
//@ pretty-expanded FIXME #23616
static mut n_mut: usize = 0;
static n: &'static usize = unsafe { &n_mut };
//~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
fn main() {}