Skip to content

Rename splat to avoid stable name collisions - #159817

Open
teor2345 wants to merge 5 commits into
rust-lang:mainfrom
teor2345:splat-rename-nightly
Open

Rename splat to avoid stable name collisions#159817
teor2345 wants to merge 5 commits into
rust-lang:mainfrom
teor2345:splat-rename-nightly

Conversation

@teor2345

@teor2345 teor2345 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tracking issue: #153629

This PR renames #[splat] to #[rustc_splat], in a mostly automated way (using fastmod).

The rename commands I used were:

fastmod --fixed-strings '#[splat]' '#[rustc_splat]'
fastmod --fixed-strings '`splat` attribute' '`rustc_splat` attribute'
# I'm pretty sure the symbol demangling commands are no-ops on beta
# Legacy symbol demangling
fastmod --fixed-strings '$splat$' '$rustc_splat$'
# Revert some changes that aren't in rustc_demangle yet
fastmod 'v0(.*)#\[rustc_splat\]' 'v0${1}#[splat]' tests/ui/splat/splat-mangling.rs

Part of #159428

Backport Advice

Cherry-pick the first commit to the beta branch, then run the fastmod commands above.
I've tested this locally (with a slightly different name), and it works, see my splat-rename-beta branch.

Remaining Work

rustc_demangle needs an update to the attribute name, a release, and then a version bump in rust-lang/rust. I'll do that separately. It doesn't need to be backported, because the last version bump was after beta branched.

There's also some external code that needs updates, the full list is in the ticket: #159428 (comment)

@rustbot label +beta-nominated +A-attributes +A-macros +A-resolve +C-bug +F-splat +P-high +T-compiler

@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

The reflection data structures are tied exactly to the implementation
in the compiler. Make sure to also adjust rustc_const_eval/src/const_eval/type_info.rs

cc @oli-obk

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

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

cc @rust-lang/rustfmt

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Jul 24, 2026
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Jul 24, 2026
@rustbot

This comment was marked as outdated.

@rustbot

This comment was marked as outdated.

@teor2345

Copy link
Copy Markdown
Contributor Author

No P-high for me!

@rustbot label +beta-nominated +A-attributes +A-macros +A-resolve +C-bug +F-splat +T-compiler

@rustbot rustbot added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Name/path resolution done by `rustc_resolve` specifically beta-nominated Nominated for backporting to the compiler in the beta channel. C-bug Category: This is a bug. F-splat `#![feature(splat)]` https://github.com/rust-lang/rust/issues/153629 labels Jul 24, 2026
@teor2345 teor2345 changed the title Splat rename nightly Rename splat to avoid stable name collisions Jul 24, 2026
@teor2345
teor2345 marked this pull request as draft July 24, 2026 07:13
@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 24, 2026
@jieyouxu

Copy link
Copy Markdown
Member

FWIW we only assign P-* for issues not PRs; I'm happy to review the rename.
r? me

@rustbot rustbot assigned jieyouxu and unassigned fee1-dead Jul 24, 2026
@apiraino

Copy link
Copy Markdown
Contributor

I will "de-nominate" from backport as now it's a bit too early. Feel free to nominate again when the PR is reviewed and approved :)

@rustbot label -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 24, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@ytmimi ytmimi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please restore src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs, src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs, src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs, src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs

Removing these files is causing rustfmt test failures:

  thread '<unnamed>' (54612) panicked at src/tools/rustfmt/src/test/mod.rs:842:40:
  called `Result::unwrap()` on an `Err` value: ModuleResolutionError(ModuleResolutionError { module: "ZYXW", kind: NotFound { file: "tests/target/reorder_modules/ZYXW.rs" }

View changes since this review

@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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

@teor2345
teor2345 marked this pull request as ready for review July 29, 2026 06:36
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2026
@teor2345

Copy link
Copy Markdown
Contributor Author

This should be ready for review again.

The search and replace is less complicated, but making the attribute longer means there's some long lines to reformat or tidy up. Most of these are in tests that aren't in the beta branch.

@rustbot ready

@rust-bors

This comment has been minimized.

@teor2345

Copy link
Copy Markdown
Contributor Author

Pretty sure that was #160049, I'll rebase tomorrow. This PR is likely to be bitrotty, because there's a lot of search and replace.

@theemathas theemathas added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 29, 2026
teor2345 added 5 commits July 30, 2026 10:58
fastmod --fixed-strings '#[splat]' '#[rustc_splat]'
fastmod --fixed-strings '`splat` attribute' '`rustc_splat` attribute'
fastmod --fixed-strings '$splat$' '$rustc_splat$'
fastmod 'v0(.*)#\[rustc_splat\]' 'v0${1}#[splat]' tests/ui/splat/splat-mangling.rs
@teor2345
teor2345 force-pushed the splat-rename-nightly branch from 6adf92b to bc1bb27 Compare July 30, 2026 01:00
@rustbot

rustbot commented Jul 30, 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.

@jieyouxu jieyouxu removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Name/path resolution done by `rustc_resolve` specifically beta-nominated Nominated for backporting to the compiler in the beta channel. C-bug Category: This is a bug. F-splat `#![feature(splat)]` https://github.com/rust-lang/rust/issues/153629 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. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants