Closed
Description
@bstrie So, this code raises an assertion in llvm when compiling with -g. Without -g it works fine.
#![feature(unboxed_closures)]
pub struct A;
impl A {
pub fn foo(&self, f: Box<Fn<(), ()> + 'static>) ->
Box<Fn<(), ()> + 'static> {
(box move |&:| {
(*f).call(())
})
}
}
Raised assertion is
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/lib/IR/Instructions.cpp:1086: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
[1] 1800 abort (core dumped) rustc --crate-type lib test.rs -g
Edit: reduced code more