On Mon, Oct 8, 2012 at 5:14 PM, Amitava Shee <[email protected]> wrote:
> I get an assertion failure while trying to compile the following
>
> use io::println;
>
> fn main() {
>   trait Text {
>     fn to_str(&self) -> ~str;
>   }
>
>   fn to_string(t: Text) {
>     println(t.to_str());
>   }
>
> }
>
> amitava:l2 amitava$ rustc -g trait.rs
> Assertion failed: (Ty && "Invalid GetElementPtrInst indices for type!"),
> function checkGEPType, file
> /Users/amitava/opt/rust/src/rust/src/llvm/include/llvm/Instructions.h, line
> 705.
> Abort trap: 6
>
> Clearly, this code is nonsensical since there is no implementation of the
> trait "Text". Should the compiler produce a different message?
>

Yes, this is a compiler bug. Would you mind filling out an issue report at:

https://github.com/mozilla/rust/issues/new

? (Don't worry about any of the labels or fields; we'll take care of that.)

Thanks,

Tim

-- 
Tim Chevalier * http://catamorphism.org/ * Often in error, never in doubt
'Wouldn't you rather be anything other than the kid who runs around
telling stuff what he thinks it is?" -- DavEnd
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to