Closed
Description
rust version: rustc 0.12.0-pre-nightly (09abbbd 2014-09-11 00:05:41 +0000)
Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/llvm/lib/IR/Instructions.cpp, line 1085.
code to reproduce:
trait Tr: Clone {
fn clone_to_tobj(&self) -> Box<Tr> {
return box self.clone()
}
}
#[deriving(Clone)]
struct A;
impl Tr for A {
}
fn main() {
let a: Box<Tr> = box A;
}
but this compiles fine
trait Tr: Clone {
fn clone_to_tobj(&self) -> Box<Tr> {
box self.clone()
}
}
#[deriving(Clone)]
struct A;
impl Tr for A {
}
fn main() {
let a: Box<Tr> = box A;
}