also adjust the wording a little so that we don't say "the error occurred here" for two different spans
20 lines
903 B
Text
20 lines
903 B
Text
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`.
|