]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/impl-fn-hrtb-bounds.stderr
Resolve lifetimes using the regular logic for RPIT.
[rust.git] / src / test / ui / impl-trait / impl-fn-hrtb-bounds.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/impl-fn-hrtb-bounds.rs:22:38
3    |
4 LL | fn d() -> impl Fn() -> (impl Debug + '_) {
5    |                                      ^^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
8 help: consider using the `'static` lifetime
9    |
10 LL | fn d() -> impl Fn() -> (impl Debug + 'static) {
11    |                                      ~~~~~~~
12
13 error: higher kinded lifetime bounds on nested opaque types are not supported yet
14   --> $DIR/impl-fn-hrtb-bounds.rs:4:41
15    |
16 LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
17    |                                         ^^
18    |
19 note: lifetime declared here
20   --> $DIR/impl-fn-hrtb-bounds.rs:4:19
21    |
22 LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
23    |                   ^
24
25 error: lifetime may not live long enough
26   --> $DIR/impl-fn-hrtb-bounds.rs:6:9
27    |
28 LL |     |x| x
29    |      -- ^ returning this value requires that `'1` must outlive `'2`
30    |      ||
31    |      |return type of closure is impl Debug + '2
32    |      has type `&'1 u8`
33
34 error: higher kinded lifetime bounds on nested opaque types are not supported yet
35   --> $DIR/impl-fn-hrtb-bounds.rs:10:52
36    |
37 LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
38    |                                                    ^^
39    |
40 note: lifetime declared here
41   --> $DIR/impl-fn-hrtb-bounds.rs:10:20
42    |
43 LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
44    |                    ^^
45
46 error: lifetime may not live long enough
47   --> $DIR/impl-fn-hrtb-bounds.rs:12:9
48    |
49 LL |     |x| x
50    |      -- ^ returning this value requires that `'1` must outlive `'2`
51    |      ||
52    |      |return type of closure is impl Debug + '2
53    |      has type `&'1 u8`
54
55 error: higher kinded lifetime bounds on nested opaque types are not supported yet
56   --> $DIR/impl-fn-hrtb-bounds.rs:16:52
57    |
58 LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
59    |                                                    ^^
60    |
61 note: lifetime declared here
62   --> $DIR/impl-fn-hrtb-bounds.rs:16:20
63    |
64 LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
65    |                    ^^
66
67 error: lifetime may not live long enough
68   --> $DIR/impl-fn-hrtb-bounds.rs:18:9
69    |
70 LL |     |x| x
71    |      -- ^ returning this value requires that `'1` must outlive `'2`
72    |      ||
73    |      |return type of closure is impl Debug + '2
74    |      has type `&'1 u8`
75
76 error: aborting due to 7 previous errors
77
78 For more information about this error, try `rustc --explain E0106`.