Hi,
I am wondering why this little code doesn't compile:
trait Foo {
}
trait Bar {
type T : Foo;
fn func(&self, _: &dyn Self::T);
}
Claiming that type T
is not found in Self
:
error[E0405]: cannot find trait `T` in `Self`
--> src/lib.rs:25:34
|
25 | fn func(&self, _: &dyn Self::T);
| ^ not found in `Self`
While if I remove the dyn
keyword it compiles with no errors.
Thank you