1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
pub trait TestTrait { type MyType; fn func() -> Option<Self> where Self: Sized; } impl<T> dyn TestTrait<MyType = T> where Self: Sized, // pesky sized predicate { fn other_func() -> dyn TestTrait<MyType = T> { match Self::func() { None => None, //~^ ERROR mismatched types } } } fn main() {}