Skip to content

Fix splat v0 mangling#158890

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
teor2345:splat-mangling-clash
Jul 22, 2026
Merged

Fix splat v0 mangling#158890
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
teor2345:splat-mangling-clash

Conversation

@teor2345

@teor2345 teor2345 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

View all comments

Tracking issue: #153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: #159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes #158644

This PR was based on #159202, so we waited for that PR to merge first, then rebased this one.

@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 Jul 7, 2026
@rustbot

rustbot commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

r? @hanna-kruppe

rustbot has assigned @hanna-kruppe.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 20 candidates

@rustbot rustbot added A-name-mangling Area: Name mangling / decoration aka symbol mangling C-bug Category: This is a bug. F-splat `#![feature(splat)]` https://github.com/rust-lang/rust/issues/153629 labels Jul 7, 2026
@rust-log-analyzer

This comment has been minimized.

@teor2345

This comment was marked as resolved.

@wesleywiser wesleywiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so you know, changes to the mangling scheme typically also have a corresponding PR to https://github.com/rust-lang/rustc-demangle 🙂

View changes since this review

Comment thread compiler/rustc_symbol_mangling/src/v0.rs Outdated
@teor2345
teor2345 force-pushed the splat-mangling-clash branch 2 times, most recently from a30c0d8 to afaae5b Compare July 8, 2026 03:16
Comment thread tests/ui/splat/splat-mangling-issue-158644.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 8, 2026
@rustbot

rustbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@hanna-kruppe

Copy link
Copy Markdown
Contributor

r? wesleywiser

@rustbot

rustbot commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-clippy Relevant to the Clippy team. labels Jul 13, 2026
@rustbot

This comment has been minimized.

@teor2345

teor2345 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

The rustc-demangle version bump is in #159202, this PR starts with the commits from that PR, then has the working splat mangling and tests on top of them.

This PR should wait to merge until after #159202 merges, just in case we drop some of the version bumps from that PR.

@ada4a ada4a closed this Jul 13, 2026
@teor2345
teor2345 force-pushed the splat-mangling-clash branch from 36d0eb8 to a34aad0 Compare July 18, 2026 00:32
@rustbot

rustbot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

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.

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I squashed most commits, but I left one of the symbol clash tests in a separate commit, because it depends on incremental compilation state.

(I found the issue without incremental compilation, but it involved a race condition or local state that would only trigger the linker error some of the time. The test seems stable in CI and locally now, but I want to leave it in a separate commit, just in case it becomes flaky.)

View changes since this review

Comment on lines +23 to +28
//[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main66Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u8$C$u32$RP$$RP$$GT
//[legacy]~| ERROR demangling(splat_mangling::main::Type<fn(, #[splat](u8,u32))>::
//[legacy]~| ERROR demangling-alt(splat_mangling::main::Type<fn(, #[splat](u8,u32))>)
//[v0,default]~^^^^ ERROR symbol-name(_RMNvCsCRATE_HASH_14splat_mangling4mainINtB<REF>_4TypeFwThmEEuE)
//[v0,default]~| ERROR demangling(<splat_mangling[
//[v0,default]~| ERROR demangling-alt(<splat_mangling::main::Type<fn(#[splat] (u8, u32))>>)

@teor2345 teor2345 Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's based on the existing mangling tests, so that the ERROR and symbol names line up across different variants, making them easier to compare.

Edit: this was extremely useful when comparing the splatted and non-splatted mangling.

#[rustc_dump_symbol_name]
//[legacy]~^ ERROR symbol-name(_ZN5basic4main
//[legacy]~| ERROR demangling(basic::main
//[legacy]~| ERROR demangling-alt(basic::main)
//[v0]~^^^^ ERROR symbol-name(_RNv
//[v0]~| ERROR demangling(basic[
//[v0]~| ERROR demangling-alt(basic::main)

@teor2345

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@wesleywiser

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a34aad0 has been approved by wesleywiser

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 21, 2026
…esleywiser

Fix splat v0 mangling

Tracking issue: rust-lang#153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: rust-lang#159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes rust-lang#158644

This PR was based on rust-lang#159202, so we waited for that PR to merge first, then rebased this one.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 21, 2026
…esleywiser

Fix splat v0 mangling

Tracking issue: rust-lang#153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: rust-lang#159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes rust-lang#158644

This PR was based on rust-lang#159202, so we waited for that PR to merge first, then rebased this one.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 21, 2026
…esleywiser

Fix splat v0 mangling

Tracking issue: rust-lang#153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: rust-lang#159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes rust-lang#158644

This PR was based on rust-lang#159202, so we waited for that PR to merge first, then rebased this one.
rust-bors Bot pushed a commit that referenced this pull request Jul 21, 2026
Rollup of 12 pull requests

Successful merges:

 - #159582 (Sync from portable simd 2026 07 20)
 - #158890 (Fix splat v0 mangling)
 - #159411 ([rustdoc] Correctly handle output options with --show-coverage)
 - #159647 (Remove `early_exit` closures)
 - #159656 (define a `Simd` type in `minicore`)
 - #156474 (Add paths for linked associated items)
 - #159211 (Fix debuginfo argument when invoking LLBC linker)
 - #159527 (Bring runtime symbols statics on par with foreign functions)
 - #159625 (Refactor is_opsem_inhabited)
 - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`)
 - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap )
 - #159663 (Add layout cycle hang regression test)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 22, 2026
…esleywiser

Fix splat v0 mangling

Tracking issue: rust-lang#153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: rust-lang#159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes rust-lang#158644

This PR was based on rust-lang#159202, so we waited for that PR to merge first, then rebased this one.
rust-bors Bot pushed a commit that referenced this pull request Jul 22, 2026
Rollup of 13 pull requests

Successful merges:

 - #159582 (Sync from portable simd 2026 07 20)
 - #158890 (Fix splat v0 mangling)
 - #159614 (debuginfo generation for unsafe binders)
 - #159647 (Remove `early_exit` closures)
 - #159656 (define a `Simd` type in `minicore`)
 - #156474 (Add paths for linked associated items)
 - #159211 (Fix debuginfo argument when invoking LLBC linker)
 - #159527 (Bring runtime symbols statics on par with foreign functions)
 - #159625 (Refactor is_opsem_inhabited)
 - #159629 (Add more splat rust-call regression tests)
 - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`)
 - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap )
 - #159663 (Add layout cycle hang regression test)
rust-bors Bot pushed a commit that referenced this pull request Jul 22, 2026
Rollup of 13 pull requests

Successful merges:

 - #159582 (Sync from portable simd 2026 07 20)
 - #158890 (Fix splat v0 mangling)
 - #159614 (debuginfo generation for unsafe binders)
 - #159647 (Remove `early_exit` closures)
 - #159656 (define a `Simd` type in `minicore`)
 - #156474 (Add paths for linked associated items)
 - #159211 (Fix debuginfo argument when invoking LLBC linker)
 - #159527 (Bring runtime symbols statics on par with foreign functions)
 - #159625 (Refactor is_opsem_inhabited)
 - #159629 (Add more splat rust-call regression tests)
 - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`)
 - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap )
 - #159663 (Add layout cycle hang regression test)
@rust-bors
rust-bors Bot merged commit 4609c87 into rust-lang:main Jul 22, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 22, 2026
rust-timer added a commit that referenced this pull request Jul 22, 2026
Rollup merge of #158890 - teor2345:splat-mangling-clash, r=wesleywiser

Fix splat v0 mangling

Tracking issue: #153629

Typecheck considers a splatted and non-splatted function as distinct types, so mangling has to include splatting. If it doesn't, we get symbol clashes. See the ticket and the tests in this PR for details.

Demangling PR: rust-lang/rustc-demangle#90
Demangling in rust-lang/rust PR: #159202

@rustbot label +C-bug +F-splat +T-compiler +A-name-mangling

Fixes #158644

This PR was based on #159202, so we waited for that PR to merge first, then rebased this one.
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jul 22, 2026
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#159582 (Sync from portable simd 2026 07 20)
 - rust-lang/rust#158890 (Fix splat v0 mangling)
 - rust-lang/rust#159614 (debuginfo generation for unsafe binders)
 - rust-lang/rust#159647 (Remove `early_exit` closures)
 - rust-lang/rust#159656 (define a `Simd` type in `minicore`)
 - rust-lang/rust#156474 (Add paths for linked associated items)
 - rust-lang/rust#159211 (Fix debuginfo argument when invoking LLBC linker)
 - rust-lang/rust#159527 (Bring runtime symbols statics on par with foreign functions)
 - rust-lang/rust#159625 (Refactor is_opsem_inhabited)
 - rust-lang/rust#159629 (Add more splat rust-call regression tests)
 - rust-lang/rust#159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`)
 - rust-lang/rust#159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap )
 - rust-lang/rust#159663 (Add layout cycle hang regression test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-name-mangling Area: Name mangling / decoration aka symbol mangling C-bug Category: This is a bug. F-splat `#![feature(splat)]` https://github.com/rust-lang/rust/issues/153629 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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.

Splat is ignored in symbol mangling, leading to symbol clashes

7 participants