Skip to content

Conversation

@RalfJung
Copy link
Member

@RalfJung RalfJung commented Nov 9, 2025

The reference PR that goes with rust-lang/rust#148746.

Fixes #2074.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Nov 9, 2025
@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Nov 11, 2025
@RalfJung
Copy link
Member Author

FCP passed, rust-lang/rust#148746 is in the bors queue now.

@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Nov 30, 2025
traviscross and others added 3 commits November 30, 2025 02:49
The rule is that "mutable references contained within a mutable static
may be referenced in the final value of a constant."

However, the key here is that "mutable static" means either a `static
mut` item or a `static` item with an interior mutable type.  We had
made that clear over in `const-eval.const-expr.path-static` but not in
our rules about const item validity, and our link for "mutable static"
had implied it may mean `static mut`.

Let's fix that and add an example to demonstrate the point.
These link reference definitions were used in `const.no-mut-refs` and
are no longer needed.
@rustbot
Copy link
Collaborator

rustbot commented Nov 30, 2025

This PR was rebased onto a different master 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.

@traviscross
Copy link
Contributor

I had a WIP commit to clean up the language we're about to delete. If the commit looks OK to you, I'd like to put this in the history for posterity's stake. I've stacked your commit onto it and also deleted the link reference definitions that are now unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Note in no-mutable-refs in consts is confusing

4 participants