Skip to content

Conversation

@JohnTitor
Copy link
Member

Closes #151131
r? @estebank

I've skipped to expand catching below code as a mutable reference shouldn't be involved (maybe a new lint would be needed?):

static mut COUNTER: u64 = 0;
fn main() {
    unsafe { COUNTER = 1 };
}

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2026
@rust-log-analyzer

This comment has been minimized.

@JohnTitor JohnTitor force-pushed the interior-mutability-sugg branch from 41e2b83 to b9914a8 Compare January 19, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide suggestion when creating static mut of type with internal mutability

4 participants