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
8
+
--> $DIR/const-points-to-static.rs:5:1
9
+
|
10
+
LL | const TEST: &u8 = &MY_STATIC;
11
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "constants accessing static items" needs an rfc before being allowed inside constants
12
+
|
13
+
= 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.
14
+
15
+
error: aborting due to previous error
16
+
17
+
For more information about this error, try `rustc --explain E0080`.
LL | | unsafe { &*(&FOO as *const _ as *const usize) }
43
+
LL | |
44
+
LL | | };
45
+
| |__^ "constants accessing static items" needs an rfc before being allowed inside constants
46
+
|
47
+
= 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.
48
+
49
+
error[E0080]: it is undefined behavior to use this value
50
+
--> $DIR/const_refers_to_static.rs:33:1
51
+
|
52
+
LL | / const BOO_OK: &usize = {
53
+
LL | | static FOO: usize = 0;
54
+
LL | | &FOO
55
+
LL | |
56
+
LL | | };
57
+
| |__^ "constants accessing static items" needs an rfc before being allowed inside constants
58
+
|
59
+
= 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.
60
+
61
+
error: aborting due to 2 previous errors
62
+
63
+
For more information about this error, try `rustc --explain E0080`.
0 commit comments