Skip to content

Commit d734d22

Browse files
committed
Adjust anonymous-higher-ranked-lifetime.rs
- Document `anonymous-higher-ranked-lifetime.rs` - Move `anonymous-higher-ranked-lifetime.rs` to `tests/ui/higher-ranked`
1 parent b5c7a55 commit d734d22

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

Diff for: tests/ui/anonymous-higher-ranked-lifetime.rs renamed to tests/ui/higher-ranked/anonymous-higher-ranked-lifetime.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! Diagnostics test to check that higher-ranked lifetimes are properly named when being pretty
2+
//! printed in diagnostics.
3+
//!
4+
//! Issue: <https://github.com/rust-lang/rust/issues/44887>
5+
//! PR: <https://github.com/rust-lang/rust/pull/44888>
6+
17
fn main() {
28
f1(|_: (), _: ()| {}); //~ ERROR type mismatch
39
f2(|_: (), _: ()| {}); //~ ERROR type mismatch

Diff for: tests/ui/anonymous-higher-ranked-lifetime.stderr renamed to tests/ui/higher-ranked/anonymous-higher-ranked-lifetime.stderr

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0631]: type mismatch in closure arguments
2-
--> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
2+
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
33
|
44
LL | f1(|_: (), _: ()| {});
55
| ^^^--------------^^^^
@@ -10,7 +10,7 @@ LL | f1(|_: (), _: ()| {});
1010
= note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
1111
found closure signature `fn((), ()) -> _`
1212
note: required by a bound in `f1`
13-
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:25
13+
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:25
1414
|
1515
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
1616
| ^^^^^^^^^^^^ required by this bound in `f1`
@@ -20,7 +20,7 @@ LL | f1(|_: &(), _: &()| {});
2020
| + +
2121

2222
error[E0631]: type mismatch in closure arguments
23-
--> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
23+
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
2424
|
2525
LL | f2(|_: (), _: ()| {});
2626
| ^^^--------------^^^^
@@ -31,7 +31,7 @@ LL | f2(|_: (), _: ()| {});
3131
= note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
3232
found closure signature `fn((), ()) -> _`
3333
note: required by a bound in `f2`
34-
--> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
34+
--> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
3535
|
3636
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
3737
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
@@ -41,7 +41,7 @@ LL | f2(|_: &(), _: &()| {});
4141
| + +
4242

4343
error[E0631]: type mismatch in closure arguments
44-
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
44+
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
4545
|
4646
LL | f3(|_: (), _: ()| {});
4747
| ^^^--------------^^^^
@@ -52,7 +52,7 @@ LL | f3(|_: (), _: ()| {});
5252
= note: expected closure signature `for<'a> fn(&(), &'a ()) -> _`
5353
found closure signature `fn((), ()) -> _`
5454
note: required by a bound in `f3`
55-
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
55+
--> $DIR/anonymous-higher-ranked-lifetime.rs:24:29
5656
|
5757
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
5858
| ^^^^^^^^^^^^^^^ required by this bound in `f3`
@@ -62,7 +62,7 @@ LL | f3(|_: &(), _: &()| {});
6262
| + +
6363

6464
error[E0631]: type mismatch in closure arguments
65-
--> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
65+
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
6666
|
6767
LL | f4(|_: (), _: ()| {});
6868
| ^^^--------------^^^^
@@ -73,7 +73,7 @@ LL | f4(|_: (), _: ()| {});
7373
= note: expected closure signature `for<'a, 'r> fn(&'a (), &'r ()) -> _`
7474
found closure signature `fn((), ()) -> _`
7575
note: required by a bound in `f4`
76-
--> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
76+
--> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
7777
|
7878
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
7979
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
@@ -83,7 +83,7 @@ LL | f4(|_: &(), _: &()| {});
8383
| + +
8484

8585
error[E0631]: type mismatch in closure arguments
86-
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
86+
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
8787
|
8888
LL | f5(|_: (), _: ()| {});
8989
| ^^^--------------^^^^
@@ -94,7 +94,7 @@ LL | f5(|_: (), _: ()| {});
9494
= note: expected closure signature `for<'r> fn(&'r (), &'r ()) -> _`
9595
found closure signature `fn((), ()) -> _`
9696
note: required by a bound in `f5`
97-
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:25
97+
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
9898
|
9999
LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
100100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
@@ -104,7 +104,7 @@ LL | f5(|_: &(), _: &()| {});
104104
| + +
105105

106106
error[E0631]: type mismatch in closure arguments
107-
--> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
107+
--> $DIR/anonymous-higher-ranked-lifetime.rs:13:5
108108
|
109109
LL | g1(|_: (), _: ()| {});
110110
| ^^^--------------^^^^
@@ -115,7 +115,7 @@ LL | g1(|_: (), _: ()| {});
115115
= note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
116116
found closure signature `fn((), ()) -> _`
117117
note: required by a bound in `g1`
118-
--> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
118+
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
119119
|
120120
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
121121
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
@@ -125,7 +125,7 @@ LL | g1(|_: &(), _: ()| {});
125125
| +
126126

127127
error[E0631]: type mismatch in closure arguments
128-
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
128+
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
129129
|
130130
LL | g2(|_: (), _: ()| {});
131131
| ^^^--------------^^^^
@@ -136,7 +136,7 @@ LL | g2(|_: (), _: ()| {});
136136
= note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _`
137137
found closure signature `fn((), ()) -> _`
138138
note: required by a bound in `g2`
139-
--> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
139+
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
140140
|
141141
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
142142
| ^^^^^^^^^^^^^^^^ required by this bound in `g2`
@@ -146,7 +146,7 @@ LL | g2(|_: &(), _: ()| {});
146146
| +
147147

148148
error[E0631]: type mismatch in closure arguments
149-
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
149+
--> $DIR/anonymous-higher-ranked-lifetime.rs:15:5
150150
|
151151
LL | g3(|_: (), _: ()| {});
152152
| ^^^--------------^^^^
@@ -157,7 +157,7 @@ LL | g3(|_: (), _: ()| {});
157157
= note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
158158
found closure signature `fn((), ()) -> _`
159159
note: required by a bound in `g3`
160-
--> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
160+
--> $DIR/anonymous-higher-ranked-lifetime.rs:31:25
161161
|
162162
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
163163
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
@@ -167,7 +167,7 @@ LL | g3(|_: &(), _: ()| {});
167167
| +
168168

169169
error[E0631]: type mismatch in closure arguments
170-
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
170+
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
171171
|
172172
LL | g4(|_: (), _: ()| {});
173173
| ^^^--------------^^^^
@@ -178,7 +178,7 @@ LL | g4(|_: (), _: ()| {});
178178
= note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
179179
found closure signature `fn((), ()) -> _`
180180
note: required by a bound in `g4`
181-
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
181+
--> $DIR/anonymous-higher-ranked-lifetime.rs:32:25
182182
|
183183
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
184184
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
@@ -188,7 +188,7 @@ LL | g4(|_: &(), _: ()| {});
188188
| +
189189

190190
error[E0631]: type mismatch in closure arguments
191-
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
191+
--> $DIR/anonymous-higher-ranked-lifetime.rs:17:5
192192
|
193193
LL | h1(|_: (), _: (), _: (), _: ()| {});
194194
| ^^^----------------------------^^^^
@@ -199,7 +199,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
199199
= note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
200200
found closure signature `fn((), (), (), ()) -> _`
201201
note: required by a bound in `h1`
202-
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
202+
--> $DIR/anonymous-higher-ranked-lifetime.rs:35:25
203203
|
204204
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
205205
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
@@ -209,7 +209,7 @@ LL | h1(|_: &(), _: (), _: &(), _: ()| {});
209209
| + +
210210

211211
error[E0631]: type mismatch in closure arguments
212-
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
212+
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
213213
|
214214
LL | h2(|_: (), _: (), _: (), _: ()| {});
215215
| ^^^----------------------------^^^^
@@ -220,7 +220,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
220220
= note: expected closure signature `for<'a, 't0> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
221221
found closure signature `fn((), (), (), ()) -> _`
222222
note: required by a bound in `h2`
223-
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
223+
--> $DIR/anonymous-higher-ranked-lifetime.rs:36:25
224224
|
225225
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
226226
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`

0 commit comments

Comments
 (0)