Suggest installing `rust-std` component when spans pointing at std can't find the sources
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
https://users.rust-lang.org/t/any-plans-for-improving-error-diagnostic-in-rust-2-0/139956/12
We have a fallback for span sources not being found, rendering labels as notes. But it would be reasonable to include a suggestion in the output when we encounter them, exclusively for the std when the current rustc is from a standard installation through rustup, telling people to use rustup to install the std sources locally so that subsequent errors will provide the desired output. For non-standard installs (like local dev or through package managers) we can either not say anything, or hint towards it. For missing spans from other crates, the current behavior is likely fine (and less likely to occur in the first place).
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 tracing the fallback that renders labels as notes when span sources are missing, then inspect how the compiler can identify standard rustup installations and missing std sources. Done means std-source failures from rustup installations suggest installing the rust-std component, while non-standard installs and missing sources from other crates retain the current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100