Skip to content

ICE when use-ing enum variant after glob-importing same-named enum #62767

Closed
@oberien

Description

@oberien

playpen

Reproduction code:

mod foo {
    pub enum Foo {
        Foo(i32),
    }
}
use foo::*;
use Foo::Foo;
thread 'rustc' panicked at 'assertion failed: directive.imported_module.get().is_none()', src/librustc_resolve/resolve_imports.rs:943:21
note: rustc 1.36.0 (a53f9df32 2019-07-03) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden

If I re-export pub use Foo::* in the module, it works as expected, having enum Foo in the type-namespace and variant Foo in the value-namespace (playpen).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions