1 error[E0261]: use of undeclared lifetime name `'a`
2 --> $DIR/fn-missing-lifetime-in-item.rs:1:33
4 LL | struct S1<F: Fn(&i32, &i32) -> &'a i32>(F);
5 | ^^ undeclared lifetime
7 = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
8 help: consider introducing lifetime `'a` here
10 LL | struct S1<'a, F: Fn(&i32, &i32) -> &'a i32>(F);
12 help: consider making the bound lifetime-generic with a new `'a` lifetime
14 LL | struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
17 error[E0106]: missing lifetime specifier
18 --> $DIR/fn-missing-lifetime-in-item.rs:2:32
20 LL | struct S2<F: Fn(&i32, &i32) -> &i32>(F);
21 | ---- ---- ^ expected named lifetime parameter
23 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
24 = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
25 help: consider making the bound lifetime-generic with a new `'a` lifetime
27 LL | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F);
29 help: consider introducing a named lifetime parameter
31 LL | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);
34 error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
35 --> $DIR/fn-missing-lifetime-in-item.rs:3:40
37 LL | struct S3<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
40 error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
41 --> $DIR/fn-missing-lifetime-in-item.rs:6:55
43 LL | const C: Option<Box<dyn for<'a> Fn(&usize, &usize) -> &'a usize>> = None;
46 error: aborting due to 4 previous errors
48 Some errors have detailed explanations: E0106, E0261, E0582.
49 For more information about an error, try `rustc --explain E0106`.