]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/missing-lt-for-hrtb.stderr
Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc
[rust.git] / src / test / ui / suggestions / missing-lt-for-hrtb.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/missing-lt-for-hrtb.rs:2:32
3    |
4 LL | struct S<'a>(&'a dyn Fn(&X) -> &X);
5    |                         --     ^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
8    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
9 help: consider making the bound lifetime-generic with a new `'b` lifetime
10    |
11 LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &'b X);
12    |                      +++++++    ~~~~~     ~~~
13 help: consider using the `'a` lifetime
14    |
15 LL | struct S<'a>(&'a dyn Fn(&X) -> &'a X);
16    |                                ~~~
17
18 error[E0106]: missing lifetime specifier
19   --> $DIR/missing-lt-for-hrtb.rs:2:33
20    |
21 LL | struct S<'a>(&'a dyn Fn(&X) -> &X);
22    |                         --      ^ expected named lifetime parameter
23    |
24    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
25    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
26 help: consider making the bound lifetime-generic with a new `'b` lifetime
27    |
28 LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &X<'b>);
29    |                      +++++++    ~~~~~      ~~~~~
30 help: consider using the `'a` lifetime
31    |
32 LL | struct S<'a>(&'a dyn Fn(&X) -> &X<'a>);
33    |                                 ~~~~~
34
35 error[E0106]: missing lifetime specifier
36   --> $DIR/missing-lt-for-hrtb.rs:5:40
37    |
38 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
39    |                                 --     ^ expected named lifetime parameter
40    |
41    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
42 note: these named lifetimes are available to use
43   --> $DIR/missing-lt-for-hrtb.rs:5:10
44    |
45 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
46    |          ^^              ^^
47 help: consider using one of the available lifetimes here
48    |
49 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &'lifetime X);
50    |                                         +++++++++
51
52 error[E0106]: missing lifetime specifier
53   --> $DIR/missing-lt-for-hrtb.rs:5:41
54    |
55 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
56    |                                 --      ^ expected named lifetime parameter
57    |
58    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
59 note: these named lifetimes are available to use
60   --> $DIR/missing-lt-for-hrtb.rs:5:10
61    |
62 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
63    |          ^^              ^^
64
65 error: aborting due to 4 previous errors
66
67 For more information about this error, try `rustc --explain E0106`.