fork/rust
git clone https://git.julia.blue/fork/rust
73528e339aa
1.40.0
1warning: skipping const checks 2 --> $DIR/mutable_const.rs:9:38 3 | 4LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; 5 | ^^^^^^^^^^^^^^^^^^^^ 6 7warning: skipping const checks 8 --> $DIR/mutable_const.rs:15:9 9 | 10LL | *MUTABLE_BEHIND_RAW = 99 11 | ^^^^^^^^^^^^^^^^^^^^^^^^ 12 13error: any use of this value will cause an error 14 --> $DIR/mutable_const.rs:15:9 15 | 16LL | / const MUTATING_BEHIND_RAW: () = { 17LL | | // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time. 18LL | | unsafe { 19LL | | *MUTABLE_BEHIND_RAW = 99 20 | | ^^^^^^^^^^^^^^^^^^^^^^^^ tried to modify constant memory 21... | 22LL | | } 23LL | | }; 24 | |__- 25 | 26note: lint level defined here 27 --> $DIR/mutable_const.rs:4:9 28 | 29LL | #![deny(const_err)] 30 | ^^^^^^^^^ 31 32error: aborting due to previous error 33