Skip to content

Give better error messages for visibility errors where there are defintions in both namespaces #12334

Closed
@nrc

Description

@nrc

(See #4110 and the fix in #12245).

If there are two definitions with the same name and different privacy modifiers in different namespaces, and there is an error on one of them, the error message might use the wrong kind of item name in its description.

E.g., if there is both a trait and function called foo and the latter is referred to and used, then the error message will still talk about "the trait foo" even though it is a function.

See the FIXME in privacy.rs.

We might want to do something even better than just fixing this bug - it would be nice if we could make the error messages a bit clearer as to where exactly the error is (which namespace, but not using that terminology). See discussion in #12245.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions