Skip to content

Suggest installing rust-std component when spans pointing at std can't find the sources #156402

Description

@estebank

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-dist-componentsArea: dist components, e.g. `rustc-dev`, `rustc-src`, etc.D-papercutDiagnostics: 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.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions