rust/tests/ui/nll/relate_tys/opaque-hrtb.rs
2023-01-11 09:32:08 +00:00

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