-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Suggest installing rust-std component when spans pointing at std can't find the sources #156402
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-dist-componentsArea: dist components, e.g. `rustc-dev`, `rustc-src`, etc.Area: dist components, e.g. `rustc-dev`, `rustc-src`, etc.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-dist-componentsArea: dist components, e.g. `rustc-dev`, `rustc-src`, etc.Area: dist components, e.g. `rustc-dev`, `rustc-src`, etc.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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).