]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/mutable_const.stderr
Rollup merge of #67102 - Aaron1011:patch-3, r=Mark-Simulacrum
[rust.git] / src / test / ui / consts / miri_unleashed / mutable_const.stderr
1 warning: skipping const checks
2   --> $DIR/mutable_const.rs:10:38
3    |
4 LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
5    |                                      ^^^^^^^^^^^^^^^^^^^^
6
7 error: any use of this value will cause an error
8   --> $DIR/mutable_const.rs:16:9
9    |
10 LL | / const MUTATING_BEHIND_RAW: () = {
11 LL | |     // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
12 LL | |     unsafe {
13 LL | |         *MUTABLE_BEHIND_RAW = 99
14    | |         ^^^^^^^^^^^^^^^^^^^^^^^^ tried to modify constant memory
15 LL | |     }
16 LL | | };
17    | |__-
18    |
19 note: lint level defined here
20   --> $DIR/mutable_const.rs:5:9
21    |
22 LL | #![deny(const_err)]
23    |         ^^^^^^^^^
24
25 error: aborting due to previous error
26