summary refs log tree commit diff
path: root/src/test/ui/consts/miri_unleashed/mutable_const.stderr
blob: 757f0ffb59ff7540114aad37a6d90a762bac8ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
warning: skipping const checks
  --> $DIR/mutable_const.rs:9:38
   |
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
   |                                      ^^^^^^^^^^^^^^^^^^^^

warning: skipping const checks
  --> $DIR/mutable_const.rs:15:9
   |
LL |         *MUTABLE_BEHIND_RAW = 99
   |         ^^^^^^^^^^^^^^^^^^^^^^^^

error: any use of this value will cause an error
  --> $DIR/mutable_const.rs:15:9
   |
LL | / const MUTATING_BEHIND_RAW: () = {
LL | |     // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
LL | |     unsafe {
LL | |         *MUTABLE_BEHIND_RAW = 99
   | |         ^^^^^^^^^^^^^^^^^^^^^^^^ tried to modify constant memory
...  |
LL | |     }
LL | | };
   | |__-
   |
note: lint level defined here
  --> $DIR/mutable_const.rs:4:9
   |
LL | #![deny(const_err)]
   |         ^^^^^^^^^

error: aborting due to previous error