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/dangling_raw_ptr.stderr
+7-2
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,16 @@ LL | const FOO: *const u32 = {
9
9
╾ALLOC0<imm>╼ │ ╾──────╼
10
10
}
11
11
12
-
error: encountered dangling pointer in final value of constant
12
+
error[E0080]: it is undefined behavior to use this value
13
13
--> $DIR/dangling_raw_ptr.rs:10:1
14
14
|
15
15
LL | const BAR: Union = {
16
-
| ^^^^^^^^^^^^^^^^
16
+
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (use-after-free)
17
+
|
18
+
= 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.
19
+
= note: the raw bytes of the constant (size: 8, align: 8) {
0 commit comments