Skip to content

refactor(toolchain): clean up toolchain hierarchy, pt. 3 - #5224

Merged
rami3l merged 6 commits into
rust-lang:mainfrom
rami3l:refactor/maybe-toolchain-name-cli-only
Nov 18, 2026
Merged

rami3l merged 6 commits into
rust-lang:mainfrom
rami3l:refactor/maybe-toolchain-name-cli-only

Conversation

@rami3l

@rami3l rami3l commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Part of #5092.

The main changes of this PR is that Maybe*ToolchainName types have been replaced with new local helper types in mod cli: they are not used outside of default toolchain assignments, so mod toolchain::names is probably not the suitable place for them.

In addition, the new names Default[Channel]Toolchain make it clear that they are purely for default toolchain selection.

@rami3l
rami3l force-pushed the refactor/maybe-toolchain-name-cli-only branch 3 times, most recently from be53ce4 to bf5c41f Compare November 17, 2026 11:54
@rami3l
rami3l marked this pull request as ready for review November 17, 2026 13:36
@rami3l
rami3l requested a review from djc November 17, 2026 13:36
@rami3l
rami3l force-pushed the refactor/maybe-toolchain-name-cli-only branch from bf5c41f to d5e9447 Compare November 17, 2026 14:27

@djc djc 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.

Copilot AI 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.

🟡 Changes recommended

The change suppresses active-override reporting when unsetting the default and alters alias parsing so default/ can select the wrong toolchain or fail.

2 open issues
What changed in this PR

Continues #5092 by moving default-selection helpers from the shared toolchain hierarchy into the CLI modules that use them.

Changes:

  • Replaces Maybe*ToolchainName types with CLI-local DefaultToolchain and DefaultChannelToolchain helpers.
  • Updates default-command handling and installer selection to use the new types.
  • Removes obsolete exports and renames the default-toolchain help helper.
File Description
src/​toolchain/​names.rs Removes the two default-selection wrapper types.
src/​toolchain.rs Removes exports of the obsolete types.
src/​cli/​setup_mode.rs Uses the new installer default-selection type.
src/​cli/​self_update.rs Defines DefaultChannelToolchain and updates installer handling.
src/​cli/​rustup_mode.rs Defines DefaultToolchain and restructures default-command handling.
src/​cli/​help.rs Renames the default-toolchain argument help helper.

Review effort: Balanced

View changes since this review

Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
@rami3l
rami3l force-pushed the refactor/maybe-toolchain-name-cli-only branch from d5e9447 to ee67dbb Compare November 18, 2026 13:36
@rami3l
rami3l force-pushed the refactor/maybe-toolchain-name-cli-only branch from ee67dbb to cd7d22f Compare November 18, 2026 13:43
@rustbot

rustbot commented Nov 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.

@rami3l
rami3l enabled auto-merge November 18, 2026 13:51
@rami3l
rami3l added this pull request to the merge queue Nov 18, 2026
Merged via the queue into rust-lang:main with commit 6e9dcaf Nov 18, 2026
55 of 57 checks passed
@rami3l
rami3l deleted the refactor/maybe-toolchain-name-cli-only branch November 18, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants