Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chris-morgan opened this issue Jul 13, 2013 · 2 comments

Comments

@chris-morgan
Copy link
Member

commented Jul 13, 2013

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.
@alexcrichton

This comment has been minimized.

Copy link
Member

commented Jul 13, 2013

This is probably either the same or very closely related to #2074. Not closing as a dupe because that bug says it only happens with @fn which this isn't using.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Sep 9, 2013

This passes now (I suspect my symbol changes recently have fixed this), flagging as needstest.

huonw added a commit to huonw/rust that referenced this issue Sep 16, 2013
bors added a commit that referenced this issue Sep 16, 2013
bors added a commit that referenced this issue Sep 17, 2013

@huonw huonw closed this in 4f92f45 Sep 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.