Closed
Description
This:
fn main() {
10u.to_vec();
}
trait ToVec {
fn to_vec(self);
}
impl ToVec for uint {
fn to_vec(self){}
}
causes this:
rustc: /media/linhaus/rust/src/llvm/lib/VMCore/Instructions.cpp:2383: static llvm::CastInst* llvm::CastInst::CreatePointerCast(llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `S->getType()->isPointerTy() && "Invalid cast"' failed.
Aborted
Changing self
to &self
makes it work, so it has to do with passing self by-value.