@@ -26,9 +26,6 @@ LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
26
26
error[E0311]: the parameter type `G` may not live long enough
27
27
--> $DIR/missing-lifetimes-in-signature.rs:31:5
28
28
|
29
- LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
30
- | - help: consider adding an explicit lifetime bound...: `G: 'a`
31
- ...
32
29
LL | / move || {
33
30
LL | | *dest = g.get();
34
31
LL | | }
@@ -46,13 +43,14 @@ LL | / move || {
46
43
LL | | *dest = g.get();
47
44
LL | | }
48
45
| |_____^
46
+ help: consider adding an explicit lifetime bound...
47
+ |
48
+ LL | G: Get<T> + 'a,
49
+ | ++++
49
50
50
51
error[E0311]: the parameter type `G` may not live long enough
51
52
--> $DIR/missing-lifetimes-in-signature.rs:53:5
52
53
|
53
- LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
54
- | -- help: consider adding an explicit lifetime bound...: `G: 'b +`
55
- ...
56
54
LL | / move || {
57
55
LL | | *dest = g.get();
58
56
LL | | }
@@ -70,13 +68,14 @@ LL | / move || {
70
68
LL | | *dest = g.get();
71
69
LL | | }
72
70
| |_____^
71
+ help: consider adding an explicit lifetime bound...
72
+ |
73
+ LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
74
+ | ++++
73
75
74
76
error[E0311]: the parameter type `G` may not live long enough
75
77
--> $DIR/missing-lifetimes-in-signature.rs:62:9
76
78
|
77
- LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
78
- | -- help: consider adding an explicit lifetime bound...: `G: 'c +`
79
- LL |
80
79
LL | / move || {
81
80
LL | | *dest = g.get();
82
81
LL | | }
@@ -94,13 +93,14 @@ LL | / move || {
94
93
LL | | *dest = g.get();
95
94
LL | | }
96
95
| |_________^
96
+ help: consider adding an explicit lifetime bound...
97
+ |
98
+ LL | fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
99
+ | ++++
97
100
98
101
error[E0311]: the parameter type `G` may not live long enough
99
102
--> $DIR/missing-lifetimes-in-signature.rs:74:5
100
103
|
101
- LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
102
- | -- help: consider adding an explicit lifetime bound...: `G: 'b +`
103
- ...
104
104
LL | / move || {
105
105
LL | | *dest = g.get();
106
106
LL | | }
@@ -118,6 +118,10 @@ LL | / move || {
118
118
LL | | *dest = g.get();
119
119
LL | | }
120
120
| |_____^
121
+ help: consider adding an explicit lifetime bound...
122
+ |
123
+ LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
124
+ | ++++
121
125
122
126
error[E0621]: explicit lifetime required in the type of `dest`
123
127
--> $DIR/missing-lifetimes-in-signature.rs:74:5
@@ -133,13 +137,15 @@ LL | | }
133
137
error[E0309]: the parameter type `G` may not live long enough
134
138
--> $DIR/missing-lifetimes-in-signature.rs:85:5
135
139
|
136
- LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
137
- | - help: consider adding an explicit lifetime bound...: `G: 'a`
138
- ...
139
140
LL | / move || {
140
141
LL | | *dest = g.get();
141
142
LL | | }
142
143
| |_____^ ...so that the type `G` will meet its required lifetime bounds
144
+ |
145
+ help: consider adding an explicit lifetime bound...
146
+ |
147
+ LL | G: Get<T> + 'a,
148
+ | ++++
143
149
144
150
error: aborting due to 8 previous errors
145
151
0 commit comments