Skip to content

Cannot use use Self::*; inside a method #63720

Open
@varkor

Description

@varkor
enum A {}

impl A {
    fn foo() {
        use Self::*; // error: unresolved import `Self`
    }
}

It's counterintuitive that this fails. At the very least (if it's not possible to fix this), we should special case the error message to explain the problem.
#49683 (comment) may be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions