]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[rust.git] / src / test / 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 introducing lifetime `'a` here
9    |
10 LL | struct S1<'a, F: Fn(&i32, &i32) -> &'a i32>(F);
11    |           +++
12 help: consider making the bound lifetime-generic with a new `'a` lifetime
13    |
14 LL | struct S1<F: for<'a> 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    = 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
26    |
27 LL | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F);
28    |              +++++++     ++       ++          ++
29 help: consider introducing a named lifetime parameter
30    |
31 LL | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);
32    |           +++        ++       ++          ++
33
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
36    |
37 LL | struct S3<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
38    |                                        ^^^^^^^
39
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
42    |
43 LL | const C: Option<Box<dyn for<'a> Fn(&usize, &usize) -> &'a usize>> = None;
44    |                                                       ^^^^^^^^^
45
46 error: aborting due to 4 previous errors
47
48 Some errors have detailed explanations: E0106, E0261, E0582.
49 For more information about an error, try `rustc --explain E0106`.