2020-08-10 16:42:57 -07:00
|
|
|
struct X<'a>(&'a ());
|
|
|
|
struct S<'a>(&'a dyn Fn(&X) -> &X);
|
2022-06-05 18:33:09 +02:00
|
|
|
//~^ ERROR missing lifetime specifiers
|
2020-08-10 16:42:57 -07:00
|
|
|
struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
|
2022-06-05 18:33:09 +02:00
|
|
|
//~^ ERROR missing lifetime specifiers
|
2020-08-10 16:42:57 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = S(&|x| {
|
|
|
|
println!("hi");
|
|
|
|
x
|
2024-02-01 22:45:00 +00:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
|
|
|
//~| ERROR lifetime may not live long enough
|
2020-08-10 16:42:57 -07:00
|
|
|
});
|
|
|
|
x.0(&X(&()));
|
|
|
|
}
|