Trying to use a component that is not installed runs for about a second before reporting an error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
Verification
- I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
- I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
Problem
I run into this all the time because my editor runs rustfmt --version on save to initialize the rust.vim extension's rustfmt support. If I am in a project that has set a toolchain override that doesn't have rustfmt, this makes vim hang for a second when I try to write-quit.
Steps
$ rustup component remove rustfmt
$ time rustfmt
Possible Solution(s)
No response
Notes
No response
Rustup version
rustup 1.28.2 (e4f3ad6f8 2025-04-28)
Installed toolchains
Default host: x86_64-unknown-linux-gnu
rustup home: /home/ben/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (active, default)
nightly-2025-05-22-x86_64-unknown-linux-gnu
nightly-2025-05-23-x86_64-unknown-linux-gnu
0c33fe2c3d3eecadd17a84b110bb067288a64f1c
2d5ffc513f1c56b7bc95bacb2519705096e8cc2b
45b94dd98018f2609b43a8d8e08ec5432b9e0647
55dc6112586ae887a7811648b0a8a05e1ac90162
6e23095adf9209614a45f7f75fea36dad7b92afb
8c46fcbb191b4a054f15dac8d411078faa679379
master-stage1
miri
stage1
stage2
active toolchain
----------------
name: nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
installed targets:
x86_64-unknown-linux-gnu
OS version
Linux archlinux 6.14.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 29 May 2025 21:42:15 +0000 x86_64 GNU/Linux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported rustup component remove rustfmt and time rustfmt commands with the listed toolchain setup, then trace the missing-component lookup and its error path. Done means invoking an uninstalled component reports the error without the roughly one-second delay; the issue names no source file or test to begin from.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100