1 2 3 4 5 6 7 8 9 10 11 12 13 14
trait MyTrait<T> {} struct Foo; impl<T> MyTrait<T> for Foo {} fn bar<Input>() -> impl MyTrait<Input> { Foo } fn foo() -> impl for<'a> MyTrait<&'a str> { bar() //~ ERROR implementation of `MyTrait` is not general enough } fn main() {}