-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
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.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.