Open
Description
Not sure if this needs to be an error or not.
Per rustc --explain E0207
, impl
type parameter are acceptable if they appear in the Self
type of the impl
. Emphasis mine:
Any type parameter or lifetime parameter of an
impl
must meet at least one of
the following criteria:
- it appears in the implementing type of the impl, e.g.
impl<T> Foo<T>
- for a trait impl, it appears in the implemented trait, e.g.
impl<T> SomeTrait<T> for Foo
- it is bound as an associated type, e.g.
impl<T, U> SomeTrait for T where T: AnotherTrait<AssocType=U>
Rustc currently generates an error even if an associated type of the parameter appears in the Self
type: playground link:
trait Field {}
trait Vector {
type MyField: Field;
}
struct BaseFieldPrinter<F: Field>;
impl<V: Vector> BaseFieldPrinter<V::MyField> {
}
It seems like this doesn't need to be an error, but perhaps I'm missing something?