]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/fn-missing-lifetime-in-item.stderr
Rollup merge of #107255 - lcnr:implied-b-hr, r=oli-obk
[rust.git] / tests / ui / suggestions / fn-missing-lifetime-in-item.stderr
1 error[E0261]: use of undeclared lifetime name `'a`
2   --> $DIR/fn-missing-lifetime-in-item.rs:1:33
3    |
4 LL | struct S1<F: Fn(&i32, &i32) -> &'a i32>(F);
5    |                                 ^^ undeclared lifetime
6    |
7    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
8 help: consider making the bound lifetime-generic with a new `'a` lifetime
9    |
10 LL | struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
11    |              +++++++
12 help: consider introducing lifetime `'a` here
13    |
14 LL | struct S1<'a, F: Fn(&i32, &i32) -> &'a i32>(F);
15    |           +++
16
17 error[E0106]: missing lifetime specifier
18   --> $DIR/fn-missing-lifetime-in-item.rs:2:32
19    |
20 LL | struct S2<F: Fn(&i32, &i32) -> &i32>(F);
21    |                 ----  ----     ^ expected named lifetime parameter
22    |
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 help: consider making the bound lifetime-generic with a new `'a` lifetime
25    |
26 LL | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F);
27    |              +++++++     ++       ++          ++
28 help: consider introducing a named lifetime parameter
29    |
30 LL | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);
31    |           +++        ++       ++          ++
32
33 error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
34   --> $DIR/fn-missing-lifetime-in-item.rs:3:40
35    |
36 LL | struct S3<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
37    |                                        ^^^^^^^
38
39 error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
40   --> $DIR/fn-missing-lifetime-in-item.rs:6:55
41    |
42 LL | const C: Option<Box<dyn for<'a> Fn(&usize, &usize) -> &'a usize>> = None;
43    |                                                       ^^^^^^^^^
44
45 error: aborting due to 4 previous errors
46
47 Some errors have detailed explanations: E0106, E0261, E0582.
48 For more information about an error, try `rustc --explain E0106`.