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