Closed
Description
This code:
static TEST_STR: &'static str = "abcd";
fn main() {
let s = "abcd";
match s {
TEST_STR => println!("OK"),
_ => println!("Nope")
}
}
crashes rustc with the following error message:
rustc: /home/dpx-infinity/dev/lang/rust/sources/rust/src/llvm/lib/IR/Instructions.cpp:281: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
zsh: abort (core dumped) rustc main.rs
If I remove the first match arm, the program compiles correctly.
I was able to reproduce this only with &'static str constants. Other types of constants I have used seem to work fine.
This happens on Rust 0.9. I cannot check it on master version because I can't compile it for some reason.
Metadata
Metadata
Assignees
Labels
No labels