blob: 152eeababc51a5fa5ee6b02dbe6fe5d936c8c6d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
error[E0080]: constructing invalid value: encountered a dangling reference (use-after-free)
--> $DIR/dealloc_intrinsic_dangling.rs:11:1
|
LL | const _X: &'static u8 = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^ 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[E0080]: memory access failed: ALLOC1 has been freed, so this pointer is dangling
--> $DIR/dealloc_intrinsic_dangling.rs:22:5
|
LL | *reference
| ^^^^^^^^^^ evaluation of `_Y` failed here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
|