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: creating a shared reference to mutable static is discouraged
--> web/src/lib.rs:91:40
|
91 | if let Some(element_id) = unsafe { &ROOT_ELEMENT_ID } {
| ^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
= note: this will be a hard error in the 2024 edition
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
= note: `-D static-mut-refs` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(static_mut_refs)]`
help: use `addr_of!` instead to create a raw pointer
|
91 | if let Some(element_id) = unsafe { addr_of!(ROOT_ELEMENT_ID) } {
| ~~~~~~~~~~~~~~~~~~~~~~~~~
This needs a bit of testing to verify that it has no side effects, but "hard error in 2024" sounds bad.
The text was updated successfully, but these errors were encountered:
@ThinkerDreamer There are no end-to-end tests (#61), so this case probably wouldn't be covered. It will need to be tested manually. If the website loads at all, the change is valid.
Clippy sez:
This needs a bit of testing to verify that it has no side effects, but "hard error in 2024" sounds bad.
The text was updated successfully, but these errors were encountered: