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