fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
777 B26 linesraw
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   | |         ^^^^^^^^^^^^^^^^^^^^^^^^ tried to modify constant memory
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
26