Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-papercutDiagnostics: An error or lint that needs small tweaks.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