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