I have a trait with an associated type and a generic struct::
trait Generator { type Foo; fn generate(&self) -> Self::Foo; } struct Baz
I must explain to the compiler that B is the same as A::Foo
B
A::Foo
There is a special syntax for it:
impl Baz where A: Generator, { fn add_foo(&mut self) { self.vec.push(self.generator.generate()); } }