Hi,
I don't understand why the following produces an error:
>cat test.rs
trait Foo<T> {}
struct X1;
struct X2;
impl<T: Foo<X1>> Foo<X2> for T {}
fn main() {}
>rustc test.rs
test.rs:6:0: 6:33 error: expected Foo<X2>, but found Foo<X1> (expected
struct X2 but found struct X1)
test.rs:6 impl<T: Foo<X1>> Foo<X2> for T {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
I'm trying to say "Any type that implements Foo<X1> also implements
Foo<X2>"... What's wrong here?
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev