mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
7 lines
238 B
Rust
7 lines
238 B
Rust
#![feature(const_mut_refs)]
|
|
|
|
static OH_NO: &mut i32 = &mut 42; //~ ERROR mutable references are not allowed
|
|
fn main() {
|
|
assert_eq!(*OH_NO, 42);
|
|
*OH_NO = 43; //~ ERROR cannot assign to `*OH_NO`, as `OH_NO` is an immutable static
|
|
}
|