Skip to content

Use unqualified names in type errors when possible #19792

Closed
@kmcallister

Description

@kmcallister

error: mismatched types: expected core::option::Option<alloc::arc::Arc<std::collections ::hash::map::HashMap<&'static str, alloc::arc::Arc<collections::vec::Vec<item::Item>>>>>,
found core::option::Option<alloc::arc::Arc<std::collections::hash::map::HashMap<&str, alloc::arc::Arc<collections::vec::Vec<&generator::Job>>>>>

would be much more readable as

error: mismatched types: expected Option<Arc<HashMap<&'static str, Arc<Vec<Item>>>>>,
found Option<Arc<HashMap<&str, Arc<Vec<&Job>>>>>

One possibility is to use the names in scope where the type error appears. In any event, we should make sure none of the unqualified names in a given error are ambiguous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions