rust/tests/ui/nll/relate_tys/opaque-hrtb.rs

15 lines
246 B
Rust

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() {}