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
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
8
+
= note: reference of mutable static is a hard error from 2024 edition
9
+
= note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
10
+
= note: `#[warn(static_mut_ref)]` on by default
11
+
help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
12
+
|
13
+
LL | const C: &i32 = unsafe { addr_of!(S_MUT) };
14
+
| ~~~~~~~~~~~~~~~
15
+
1
16
error[E0080]: it is undefined behavior to use this value
0 commit comments