about summary refs log tree commit diff
path: root/tests/ui/statics/mutable_memory_validation.stderr
blob: df36287cc69e68e968754fab83e6187b9cf6d3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
error[E0080]: constructing invalid value at .x.<deref>: encountered `UnsafeCell` in read-only memory
  --> $DIR/mutable_memory_validation.rs:13:1
   |
LL | const MUH: Meh = Meh { x: unsafe { &mut *(&READONLY as *const _ as *mut _) } };
   | ^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0080`.