about summary refs log tree commit diff
path: root/tests/ui/consts/write_to_static_via_mut_ref.rs
blob: dc8a7eed13d81085050e4d6b843d7e82e32ba659 (plain)
1
2
3
4
5
static OH_NO: &mut i32 = &mut 42; //~ ERROR mutable borrows of temporaries
fn main() {
    assert_eq!(*OH_NO, 42);
    *OH_NO = 43; //~ ERROR cannot assign to `*OH_NO`, as `OH_NO` is an immutable static
}