2022-02-17 07:55:58 -06:00
|
|
|
trait Trait<'a> {
|
|
|
|
type Out;
|
|
|
|
fn call(&'a self) -> Self::Out;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct X(());
|
|
|
|
|
|
|
|
impl<'a> Trait<'a> for X {
|
|
|
|
type Out = ();
|
|
|
|
fn call(&'a self) -> Self::Out {
|
|
|
|
()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f() -> impl for<'a> Trait<'a, Out = impl Sized + 'a> {
|
2024-03-07 09:44:07 -06:00
|
|
|
//~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
|
2022-02-17 07:55:58 -06:00
|
|
|
X(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = f();
|
|
|
|
}
|