static_mut_refs: Need edition migration guide documentation #123059
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
A-edition-2024
Area: The 2024 edition
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
The change for
static_mut_refs
in the 2024 Edition needs to have documentation (here) for how a user can perform a manual migration.This documentation should have a more complete explanation of why it is forbidden. Currently it just mentions use in multiple threads, but I don't think that is a complete description.
It also needs to explain to the user how to rewrite their code to make it work. My understanding is that someone can convert
&STATIC
to&*addr_of!(STATIC)
, which is equivalent, but still runs afoul of the exact same aliasing problems and undefined behavior, so I don't know if it makes sense to recommend that.&*addr_of!(…)
allowed?addr_of!
is appropriate?addr_of!
isn't the correct route, what should a user do to update their code?See also discussion at #114447 and
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/static_mut_refs
The text was updated successfully, but these errors were encountered: