Skip to content

Add interior-mutability suggestion to static_mut_refs#151362

Open
JohnTitor wants to merge 1 commit intorust-lang:mainfrom
JohnTitor:interior-mutability-sugg
Open

Add interior-mutability suggestion to static_mut_refs#151362
JohnTitor wants to merge 1 commit intorust-lang:mainfrom
JohnTitor:interior-mutability-sugg

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
@rust-bors

This comment has been minimized.

@JohnTitor JohnTitor force-pushed the interior-mutability-sugg branch from b9914a8 to 7c76d7e Compare February 8, 2026 07:54
@rustbot
Copy link
Collaborator

rustbot commented Feb 8, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 26, 2026

☔ The latest upstream changes (presumably #153124) made this pull request unmergeable. Please resolve the merge conflicts.

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