2021-10-28 00:00:00 +00:00
error[E0080]: it is undefined behavior to use this value
2024-08-17 14:19:34 +02:00
--> $DIR/interior-mut-const-via-union.rs:34:1
2021-10-28 00:00:00 +00:00
|
LL | fn main() {
2023-12-16 16:24:25 +01:00
| ^^^^^^^^^ constructing invalid value at .<deref>.y.<enum-variant(B)>.0: encountered `UnsafeCell` in read-only memory
2021-10-28 00:00:00 +00:00
|
= 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: 4, align: 4) {
2023-10-16 18:49:32 +00:00
╾ALLOC0╼ │ ╾──╼
2021-10-28 00:00:00 +00:00
}
2023-09-11 23:09:11 +02:00
note: erroneous constant encountered
2024-08-17 14:19:34 +02:00
--> $DIR/interior-mut-const-via-union.rs:36:25
2021-10-28 00:00:00 +00:00
|
LL | let _: &'static _ = &C;
2022-11-15 12:06:20 +01:00
| ^^
2021-10-28 00:00:00 +00:00
2023-09-11 23:09:11 +02:00
note: erroneous constant encountered
2024-08-17 14:19:34 +02:00
--> $DIR/interior-mut-const-via-union.rs:36:25
2022-11-15 12:06:20 +01:00
|
LL | let _: &'static _ = &C;
| ^^
2023-10-04 18:34:50 +00:00
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2022-11-15 12:06:20 +01:00
2023-11-21 20:26:31 +01:00
error: aborting due to 1 previous error
2021-10-28 00:00:00 +00:00
For more information about this error, try `rustc --explain E0080`.