Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Suggest another toolchain when removing a component unavailable to the current toolchain

Open
#5,098 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli, tooling

Research direction

Look at src/errors.rs around line 141 for the RustupError::UnknownComponents variant. The issue is about improving the error suggestion when a component add/remove fails because it's unavailable for the current toolchain. Examine how toolchain suggestions are made elsewhere (like in #4164). Start by understanding the component management logic in rustup, then modify the error handling to suggest an alternative toolchain where the component is available. Run existing tests related to component commands to ensure the new suggestion works.

Written by the indexing model from the issue text.

Description

enhancement

Similar to the case in #4164:

  1. rustup update fails (unrelated to issue)
    Image
  2. rustup target remove wasm32-wasi fails
    Image
  3. rustup +target remove wasm32-wasi succeeds, as the default toolchain was nightly as specified in .rustup/settings.toml

... however the related error kind is RustupError::UnknownComponents which would be emitted during both rustup component add and rustup component rm (instead of the rustup target rm command shown above):

https://github.com/rust-lang/rustup/blob/2919b80da905d44cc731c01add014c2eb3648aed/src/errors.rs#L141-L145

... so we should be smarter in terms of suggestions. Or, as a simplification, if suggesting rustup component add turns out to be non trivial, we can do the rustup component rm case first.

Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
1d 4h
Merged PRs (30d)
48

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rustup

All issues in rust-lang/rustup

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.