mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
15 lines
246 B
Rust
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() {}
|