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
The static_mut_refs rustc lint checks for shared or mutable references of mutable statics. This catches most incorrect uses, but doesn't necessarily accomplish the goal of moving the ecosystem away from static mut entirely.
The static_mut clippy lint will check for any declarations of mutable statics, and recommend using an immutable static with a type with interior mutability instead.
Advantage
Move the ecosystem away from static mut. May even catch some unsoundness issues.
Activity
lolbinarycat commentedon Jun 9, 2024
@rustbot claim
Add static_mut lint
Add static_mut lint
Add static_mut lint
Add static_mut lint
archief2910 commentedon Jul 1, 2024
@rustbot claim
pitaj commentedon Jul 1, 2024
pitaj commentedon Jul 1, 2024
archief2910 commentedon Jul 1, 2024
sorry @pitaj it was by mistake that's why i unassigned the issue
aaron-ang commentedon Jan 21, 2025
@lolbinarycat are you still working on this issue?
lolbinarycat commentedon Jan 21, 2025
@aaron-ang not really, no.
aaron-ang commentedon Jan 21, 2025
@pitaj can I confirm that #13770 is not related to this issue?
pitaj commentedon Jan 21, 2025
Correct, #13770 is unrelated. I was confused earlier
aaron-ang commentedon Jan 21, 2025
@rustbot claim
pitaj commentedon Jan 21, 2025
@aaron-ang you might want to read through the discussion on #12914 before putting in any work.
aaron-ang commentedon Jan 21, 2025
Thanks @pitaj. I'm aware that
static mutsemantics might change in the future.aaron-ang commentedon Jan 23, 2025
static_muthave already been disallowed inrustc: Disallow reference tostatic mutand addingstatic_mut_reflint rust#117556 and Disallow hidden references to mutable static rust#124895static_mutin the future: Deprecatestatic mutrfcs#3560, pendingconst_mut_refsto be stabilised: Tracking issue for&mut Tin const contexts (const_mut_refs) rust#57349