@@ -15,12 +15,8 @@ LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
15
15
| ^^^^^^^^^^^^ required by this bound in `f1`
16
16
help: consider borrowing the argument
17
17
|
18
- LL | f1(|_: &(), _: ()| {});
19
- | ~~~
20
- help: consider borrowing the argument
21
- |
22
- LL | f1(|_: (), _: &()| {});
23
- | ~~~
18
+ LL | f1(|_: &(), _: &()| {});
19
+ | ~~~ ~~~
24
20
25
21
error[E0631]: type mismatch in closure arguments
26
22
--> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
@@ -39,12 +35,8 @@ LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
39
35
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
40
36
help: consider borrowing the argument
41
37
|
42
- LL | f2(|_: &'a (), _: ()| {});
43
- | ~~~~~~
44
- help: consider borrowing the argument
45
- |
46
- LL | f2(|_: (), _: &()| {});
47
- | ~~~
38
+ LL | f2(|_: &'a (), _: &()| {});
39
+ | ~~~~~~ ~~~
48
40
49
41
error[E0631]: type mismatch in closure arguments
50
42
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@@ -63,12 +55,8 @@ LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
63
55
| ^^^^^^^^^^^^^^^ required by this bound in `f3`
64
56
help: consider borrowing the argument
65
57
|
66
- LL | f3(|_: &(), _: ()| {});
67
- | ~~~
68
- help: consider borrowing the argument
69
- |
70
- LL | f3(|_: (), _: &()| {});
71
- | ~~~
58
+ LL | f3(|_: &(), _: &()| {});
59
+ | ~~~ ~~~
72
60
73
61
error[E0631]: type mismatch in closure arguments
74
62
--> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
@@ -87,12 +75,8 @@ LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
87
75
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
88
76
help: consider borrowing the argument
89
77
|
90
- LL | f4(|_: &(), _: ()| {});
91
- | ~~~
92
- help: consider borrowing the argument
93
- |
94
- LL | f4(|_: (), _: &'r ()| {});
95
- | ~~~~~~
78
+ LL | f4(|_: &(), _: &'r ()| {});
79
+ | ~~~ ~~~~~~
96
80
97
81
error[E0631]: type mismatch in closure arguments
98
82
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@@ -111,19 +95,17 @@ LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
111
95
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
112
96
help: consider borrowing the argument
113
97
|
114
- LL | f5(|_: &'r (), _: ()| {});
115
- | ~~~~~~
116
- help: consider borrowing the argument
117
- |
118
- LL | f5(|_: (), _: &'r ()| {});
119
- | ~~~~~~
98
+ LL | f5(|_: &'r (), _: &'r ()| {});
99
+ | ~~~~~~ ~~~~~~
120
100
121
101
error[E0631]: type mismatch in closure arguments
122
102
--> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
123
103
|
124
104
LL | g1(|_: (), _: ()| {});
125
- | ^^ -------------- found signature defined here
126
- | |
105
+ | ^^ --------------
106
+ | | | |
107
+ | | | help: consider borrowing the argument: `&()`
108
+ | | found signature defined here
127
109
| expected due to this
128
110
|
129
111
= note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
@@ -133,17 +115,15 @@ note: required by a bound in `g1`
133
115
|
134
116
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
135
117
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
136
- help: consider borrowing the argument
137
- |
138
- LL | g1(|_: &(), _: ()| {});
139
- | ~~~
140
118
141
119
error[E0631]: type mismatch in closure arguments
142
120
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
143
121
|
144
122
LL | g2(|_: (), _: ()| {});
145
- | ^^ -------------- found signature defined here
146
- | |
123
+ | ^^ --------------
124
+ | | | |
125
+ | | | help: consider borrowing the argument: `&()`
126
+ | | found signature defined here
147
127
| expected due to this
148
128
|
149
129
= note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _`
@@ -153,17 +133,15 @@ note: required by a bound in `g2`
153
133
|
154
134
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
155
135
| ^^^^^^^^^^^^^^^^ required by this bound in `g2`
156
- help: consider borrowing the argument
157
- |
158
- LL | g2(|_: &(), _: ()| {});
159
- | ~~~
160
136
161
137
error[E0631]: type mismatch in closure arguments
162
138
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
163
139
|
164
140
LL | g3(|_: (), _: ()| {});
165
- | ^^ -------------- found signature defined here
166
- | |
141
+ | ^^ --------------
142
+ | | | |
143
+ | | | help: consider borrowing the argument: `&'s ()`
144
+ | | found signature defined here
167
145
| expected due to this
168
146
|
169
147
= note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
@@ -173,17 +151,15 @@ note: required by a bound in `g3`
173
151
|
174
152
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
175
153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
176
- help: consider borrowing the argument
177
- |
178
- LL | g3(|_: &'s (), _: ()| {});
179
- | ~~~~~~
180
154
181
155
error[E0631]: type mismatch in closure arguments
182
156
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
183
157
|
184
158
LL | g4(|_: (), _: ()| {});
185
- | ^^ -------------- found signature defined here
186
- | |
159
+ | ^^ --------------
160
+ | | | |
161
+ | | | help: consider borrowing the argument: `&()`
162
+ | | found signature defined here
187
163
| expected due to this
188
164
|
189
165
= note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
@@ -193,10 +169,6 @@ note: required by a bound in `g4`
193
169
|
194
170
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
195
171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
196
- help: consider borrowing the argument
197
- |
198
- LL | g4(|_: &(), _: ()| {});
199
- | ~~~
200
172
201
173
error[E0631]: type mismatch in closure arguments
202
174
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
@@ -215,12 +187,8 @@ LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
215
187
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
216
188
help: consider borrowing the argument
217
189
|
218
- LL | h1(|_: &(), _: (), _: (), _: ()| {});
219
- | ~~~
220
- help: consider borrowing the argument
221
- |
222
- LL | h1(|_: (), _: (), _: &(), _: ()| {});
223
- | ~~~
190
+ LL | h1(|_: &(), _: (), _: &(), _: ()| {});
191
+ | ~~~ ~~~
224
192
225
193
error[E0631]: type mismatch in closure arguments
226
194
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -239,12 +207,8 @@ LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(),
239
207
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
240
208
help: consider borrowing the argument
241
209
|
242
- LL | h2(|_: &(), _: (), _: (), _: ()| {});
243
- | ~~~
244
- help: consider borrowing the argument
245
- |
246
- LL | h2(|_: (), _: (), _: &'t0 (), _: ()| {});
247
- | ~~~~~~~
210
+ LL | h2(|_: &(), _: (), _: &'t0 (), _: ()| {});
211
+ | ~~~ ~~~~~~~
248
212
249
213
error: aborting due to 11 previous errors
250
214
0 commit comments