rust/tests/ui/suggestions/missing-lt-for-hrtb.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
382 B
Rust
Raw Normal View History

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