Closed
Description
good day. the following intentionally buggy program crashes rustc:
//buggy.rs
use std;
import std::map::hashmap;
import std::map;
fn main() {
let buggy_map :hashmap<uint, &uint> = hashmap::<uint, &uint>(uint::hash, uint::eq);
buggy_map.insert(42, ~1);
buggy_map.insert(43, ~2);
}
here is the result of "rustc buggy.rs":
rustc: /home/varnie/rust/src/llvm/lib/VMCore/Instructions.cpp:1056: 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)
rustc version is:
rustc 0.3 (6081eb7 2012-07-15 05:41:24 -0700)
host: i686-unknown-linux-gnu