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
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@chris-morgan
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 as completed in 4f92f45 Sep 17, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 7, 2021
improved help message for `suspicious_map`

`suspicious_map`'s help message assumes that the literal behavior is never the intended one, although it's sometimes.  This PR adds a mention of `inspect`, offering a idiomatic alternative.

fixes rust-lang#7767

---

changelog: Improved help message of [`suspicious_map`].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants