Skip to content

LLVM assertion failure when calling insert on a std::map::Hashmap<(@str, T), T> #4092

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

Closed
Dretch opened this issue Dec 2, 2012 · 1 comment
Assignees
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@Dretch
Copy link
Contributor

Dretch commented Dec 2, 2012

Given this code:

extern mod std;

fn main() {
    let x = std::map::HashMap();
    x.insert((@"abc", 0), 0);
}

rustc produces:

rustc: /home/gareth/projects/rust/src/llvm/lib/VMCore/Instructions.cpp:1062: void  llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
Aborted (core dumped)
@rntz
Copy link
Contributor

rntz commented Dec 2, 2012

This is due to the code committed in rntz@d718bc2, specifically the pattern match let &(ref a, ref b) = &self;. I'll go write up a workaround that avoids this pattern so that you can use HashMap<(@str,T),T> etc., but the real bug is in the compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants