Skip to content

ICE with sibling methods containing same-name-enum containing same-name-member #7770

Closed
@chris-morgan

Description

@chris-morgan

If you have two methods in an impl block, each containing an enum (with the same name), each containing at least one value with the same name, rustc gives the same LLVM symbol for the two of them and fails, as it does not include the method name in the symbol name.

Minimal test case:

pub struct Foo;
impl Foo {
    pub fn foo() {
        enum Panic { Common };
    }
    pub fn bar() {
        enum Panic { Common };
    }
}
fn main() {
}
error: internal compiler error: duplicate LLVM symbol: _ZN14__extensions__5Panic6Common7descrim17_32f9788ad4163dc87_0$x2e0E
rust: task failed at 'explicit failure', /home/chris/vc/rust/src/libsyntax/diagnostic.rs:95
rust: task failed at 'explicit failure', /home/chris/vc/rust/src/librustc/rustc.rs:355
rust: domain main @0x19ffd90 root task failed
leaked memory in rust main loop (1 objects)
rustc: /home/chris/vc/rust/src/rt/memory_region.cpp:192: memory_region::~memory_region(): Assertion `false' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions