Closed
Description
The following code:
pub fn handle(_data: &[u8]) {}
pub fn handle_opt(iter: &mut Iterator<Item = &[u8]>) {
for data in *iter {
handle(data);
}
}
give the following LLVM assert error:
$ rustc --crate-type lib lib.rs
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/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.
I really have no idea what's the LLVM IR code generated which cause this error, as I don't know how to disable LLVM IR checks at compile-time :/
My Rust version:
$ rustc -Vv
rustc 1.0.0-nightly (f4f10dba2 2015-01-17 20:31:08 +0000)
binary: rustc
commit-hash: f4f10dba2975b51c2d2c92157018db3ac13d4d4a
commit-date: 2015-01-17 20:31:08 +0000
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly