Closed
Description
Given this test case:
fn f(s: &str) {
match s {
"a" => (),
_ => (),
}
}
fn main() {}
rustc fails with:
rustc: /home/gareth/projects/rust/src/llvm/lib/VMCore/Instructions.cpp:2279: static llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
Aborted (core dumped)
I have no idea if this code should work or not. If it shouldn't work, I think rustc should emit a nicer error message.