Closed
Description
I'm not sure if the following should work, but the error message is not helpful:
#![feature(associated_types)]
pub trait Foo {
type L;
type R;
}
pub struct Bar<C, D>(C, D);
impl<C: Foo, D: Foo<L = C::L, R = C::R>> Foo for Bar<C, D> {
type L = C::L;
type R = C::R;
}
On rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)
this yields:
lib.rs:10:1: 13:2 error: type annotations required: cannot resolve `<D as Foo>::L == <C as Foo>::L`
lib.rs:10 impl<C: Foo, D: Foo<L = C::L, R = C::R>> Foo for Bar<C, D> {
lib.rs:11 type L = C::L;
lib.rs:12 type R = C::R;
lib.rs:13 }
Removing the second associated type from Foo
(R
) compiles successfully.
Metadata
Metadata
Assignees
Labels
No labels