summary refs log tree commit diff
path: root/tests/ui/statics/static-mut-shared-parens.rs
blob: 8e58152e27acd6f88a1d48fe12611ef82fb561a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//Missing paren in diagnostic msg: https://github.com/rust-lang/rust/issues/131977
//@check-pass


static mut TEST: usize = 0;

fn main() {
    let _ = unsafe { (&TEST) as *const usize };
    //~^WARN creating a shared reference to mutable static is discouraged

    let _ = unsafe { ((&mut TEST)) as *const usize };
    //~^WARN creating a mutable reference to mutable static is discouraged
}