Closed
Description
Compiling this program:
trait BogusTrait {
fn its1(self) -> int;
}
impl BogusTrait for int {
fn its1(self) -> int {1}
}
#[test] fn t1 () {assert! ((13).its1() == 1);}
produces this error message:
% ./x86_64-apple-darwin/stage2/bin/rustc --test /tmp/bug4.rs
Assertion failed: (S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"), function CreatePointerCast, file /Users/fklock/Dev/Mozilla/rust.git/src/llvm/lib/IR/Instructions.cpp, line 2394.
Abort trap: 6
(Original bug report follows)
Compiling this program:
trait BogusTrait {
fn its1(self) -> int;
}
impl int: BogusTrait {
fn its1(self) -> int {1}
}
#[test] fn t1 () {assert 13.its1() == 1;}
Produces this error message:
jclements-09740:rust-experimenting clements$ rustc --test trait-testing.rs
Assertion failed: (S->getType()->isPointerTy() && "Invalid cast"), function CreatePointerCast, file /Users/clements/rust/src/llvm/lib/VMCore/Instructions.cpp, line 2383.
Abort trap: 6