Skip to content

feat: suggest rustup component add from another installed toolchain - #5139

Open
14elias wants to merge 3 commits into
rust-lang:mainfrom
14elias:feature/component-add-suggestion
Open

14elias wants to merge 3 commits into
rust-lang:mainfrom
14elias:feature/component-add-suggestion

Conversation

@14elias

@14elias 14elias commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

related #5098

This change improves component suggestions when a requested component is not available in the active toolchain.
Previously, rustup could suggest a component removal from another toolchain, but it did not handle the add case. This patch makes component suggestions action-aware and adds a toolchain-based suggestion for rustup component add.

Comment thread src/errors.rs Outdated
Comment thread src/errors.rs
Comment thread tests/suite/cli_v2.rs Outdated
Comment on lines +1929 to +1940
cx.config
.expect(["rustup", "toolchain", "install", "stable"])
.await
.is_ok();
cx.config
.expect(["rustup", "toolchain", "install", "nightly"])
.await
.is_ok();
cx.config
.expect(["rustup", "default", "stable"])
.await
.is_ok();

@rami3l rami3l Oct 12, 2026 •

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.

Nit: rustup default stable implies rustup toolchain install stable so you can only keep the former. Same thing for the next test.

View changes since the review

@14elias
14elias force-pushed the feature/component-add-suggestion branch from 53d9b8c to ad63aa3 Compare October 12, 2026 22:26
Comment thread src/errors.rs Outdated
manifest: &Manifest,
cfg: &Cfg<'_>,
) -> Option<Self> {
Self::for_action(

@djc djc Oct 13, 2026 •

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.

IMO this callback solution isn't much better than the previous unabstracted solution. Suggest factoring out some helper functions instead.

View changes since the review

@14elias
14elias force-pushed the feature/component-add-suggestion branch from ad63aa3 to 39a0a0c Compare October 13, 2026 14:38
@14elias
14elias force-pushed the feature/component-add-suggestion branch from 39a0a0c to 951efbb Compare October 13, 2026 14:52
@14elias
14elias requested review from djc and rami3l October 14, 2026 19:24

This branch has not been deployed

No deployments
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.

3 participants