Closed
Description
The following code crashes the compiler
trait A {
}
struct S {
x: int
}
impl A for S {
}
fn new() -> Result<&A, ~str> {
Err(~"")
}
fn main() {}
rustc hello.rs
rustc: /home/s/misc/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.
Aborted (core dumped)
The crash does not occur if "&A" is replaced by "@A" or "~A".