You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.stderr
+10-5
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,19 @@
1
-
error: encountered dangling pointer in final value of constant
2
-
--> $DIR/dealloc_intrinsic_dangling.rs:7:1
1
+
error[E0080]: it is undefined behavior to use this value
2
+
--> $DIR/dealloc_intrinsic_dangling.rs:12:1
3
3
|
4
4
LL | const _X: &'static u8 = unsafe {
5
-
| ^^^^^^^^^^^^^^^^^^^^^
5
+
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (use-after-free)
6
+
|
7
+
= 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.
8
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
9
+
HEX_DUMP
10
+
}
6
11
7
12
error[E0080]: evaluation of constant value failed
8
-
--> $DIR/dealloc_intrinsic_dangling.rs:18:5
13
+
--> $DIR/dealloc_intrinsic_dangling.rs:23:5
9
14
|
10
15
LL | *reference
11
-
| ^^^^^^^^^^ memory access failed: ALLOC0 has been freed, so this pointer is dangling
16
+
| ^^^^^^^^^^ memory access failed: ALLOC1 has been freed, so this pointer is dangling
0 commit comments