summaryrefslogtreecommitdiff
path: root/tests/ui/suggestions/missing-lt-for-hrtb.rs
blob: a48c5665d67a4c3ebd04ae183b16e95c2c45e0e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct X<'a>(&'a ());
struct S<'a>(&'a dyn Fn(&X) -> &X);
//~^ ERROR missing lifetime specifiers
struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
//~^ 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(&()));
}