Closed
Description
Code:
#[deriving(Eq)]
struct Foo<T> {
x: int,
}
struct Phantom;
fn main() {
let x : Foo<Phantom> = Foo { x: 0 };
println((x == x).to_str());
}
Result:
$ rust -v
rust 0.7 (a2db7c1 2013-07-02 09:25:44 -0700)
host: x86_64-unknown-linux-gnu
$ rust run foo.rs
foo.rs:10:13: 10:19 error: failed to find an implementation of trait std::cmp::Eq for Phantom
foo.rs:10 println((x == x).to_str());