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
error[E0080]: it is undefined behavior to use this value
2
2
--> $DIR/mut_ref_in_final_dynamic_check.rs:17:1
3
3
|
4
-
LL | const A: Option<&mut i32> = helper();
5
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in a `const` or `static`
4
+
LL | const MUT: Option<&mut i32> = helper();
5
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in a `const` or `static`
6
6
|
7
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
8
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in a `const` or `static`
17
17
|
18
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
19
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
20
20
HEX_DUMP
21
21
}
22
22
23
-
error: aborting due to 2 previous errors
23
+
error[E0080]: it is undefined behavior to use this value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
28
+
|
29
+
= 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.
30
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
31
+
HEX_DUMP
32
+
}
33
+
34
+
error[E0080]: it is undefined behavior to use this value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
39
+
|
40
+
= 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.
41
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
42
+
HEX_DUMP
43
+
}
44
+
45
+
error: encountered dangling pointer in final value of constant
0 commit comments