Skip to content

Conversation

@davidtwco
Copy link
Member

Following #89117, rustc has defaulted to the v0 mangling scheme by default (since Nov 20th 2025). This surfaced two bugs:

Since there have been three-to-four months for users to find bugs with this mangling scheme on nightly, that the scheme has been waiting many years to be stabilised, and has been used successfully internally at Microsoft, Meta and Google for many years, this patch proposes stabilising the v0 mangling scheme on stable.

This patch does not propose removing the legacy mangling, it will remain usable on nightly as an escape-hatch if there are remaining bugs (though admittedly it would require switching to nightly for those on stable) - it is anticipated that this would be unlikely given current testing undergone by v0. Legacy mangling can be removed in another follow-up.

r? @wesleywiser

Following rust-lang#89117, rustc has defaulted to the v0 mangling
scheme by default (since Nov 20th 2025). This surfaced two bugs:

- rust-lang#138261 was a small ICE (found via fuzzing) where an
  implementation-internal namespace was missing for global assembly -
  this occurs with names instantiated within global assembly (that can
  happen inside constants)

- rust-lang#134479 only occurs with unstable `generic_const_exprs`

Since there have been three-to-four months for users to find bugs with
this mangling scheme on nightly, that the scheme has been waiting many
years to be stabilised, and has been used successfully internally at
Microsoft, Meta and Google for many years, this patch proposes
stabilising the v0 mangling scheme on stable.

This patch does not propose removing the legacy mangling, it will remain
usable on nightly as an escape-hatch if there are remaining bugs (though
admittedly it would require switching to nightly for those on stable) -
it is anticipated that this would be unlikely given current testing
undergone by v0. Legacy mangling can be removed in another follow-up.
@davidtwco davidtwco added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. A-name-mangling Area: name mangling / decoration labels Feb 2, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

wesleywiser is currently at their maximum review capacity.
They may take a while to respond.

@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@davidtwco
Copy link
Member Author

This will require an FCP and probably another blog post as a follow-up to the previous one.

@Kobzol
Copy link
Member

Kobzol commented Feb 2, 2026

Shouldn't -Csymbol-mangling-version=legacy be stabilized first, so that you can opt-out of v0, in case someone still needs the legacy mangling scheme?

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

Labels

A-name-mangling Area: name mangling / decoration needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

4 participants