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