rust/src/test/ui/consts/read_from_static_mut_ref.rs
2020-06-19 11:48:46 -05:00

10 lines
274 B
Rust

// We are keeping this test in case we decide to allow mutable references in statics again
#![feature(const_mut_refs)]
#![allow(const_err)]
static OH_NO: &mut i32 = &mut 42;
//~^ ERROR mutable references are not allowed in statics
fn main() {
assert_eq!(*OH_NO, 42);
}