Skip to content

Commit e50f575

Browse files
committed
Fix stderr of tests which have improved diagnostics
1 parent 1e5d772 commit e50f575

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

src/test/ui/anonymous-higher-ranked-lifetime.stderr

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ note: required by a bound in `f1`
1313
|
1414
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
1515
| ^^^^^^^^^^^^ required by this bound in `f1`
16+
help: hint: consider borrowing here:
17+
|
18+
LL | f1(|_: &(), _: ()| {});
19+
| ~~~
20+
help: hint: consider borrowing here:
21+
|
22+
LL | f1(|_: (), _: &()| {});
23+
| ~~~
1624

1725
error[E0631]: type mismatch in closure arguments
1826
--> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
@@ -29,6 +37,14 @@ note: required by a bound in `f2`
2937
|
3038
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
3139
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
40+
help: hint: consider borrowing here:
41+
|
42+
LL | f2(|_: &'a (), _: ()| {});
43+
| ~~~~~~
44+
help: hint: consider borrowing here:
45+
|
46+
LL | f2(|_: (), _: &()| {});
47+
| ~~~
3248

3349
error[E0631]: type mismatch in closure arguments
3450
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@@ -45,6 +61,14 @@ note: required by a bound in `f3`
4561
|
4662
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
4763
| ^^^^^^^^^^^^^^^ required by this bound in `f3`
64+
help: hint: consider borrowing here:
65+
|
66+
LL | f3(|_: &(), _: ()| {});
67+
| ~~~
68+
help: hint: consider borrowing here:
69+
|
70+
LL | f3(|_: (), _: &()| {});
71+
| ~~~
4872

4973
error[E0631]: type mismatch in closure arguments
5074
--> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
@@ -61,6 +85,14 @@ note: required by a bound in `f4`
6185
|
6286
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
6387
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
88+
help: hint: consider borrowing here:
89+
|
90+
LL | f4(|_: &(), _: ()| {});
91+
| ~~~
92+
help: hint: consider borrowing here:
93+
|
94+
LL | f4(|_: (), _: &'r ()| {});
95+
| ~~~~~~
6496

6597
error[E0631]: type mismatch in closure arguments
6698
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@@ -77,6 +109,14 @@ note: required by a bound in `f5`
77109
|
78110
LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
79111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
112+
help: hint: consider borrowing here:
113+
|
114+
LL | f5(|_: &'r (), _: ()| {});
115+
| ~~~~~~
116+
help: hint: consider borrowing here:
117+
|
118+
LL | f5(|_: (), _: &'r ()| {});
119+
| ~~~~~~
80120

81121
error[E0631]: type mismatch in closure arguments
82122
--> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
@@ -93,6 +133,10 @@ note: required by a bound in `g1`
93133
|
94134
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
95135
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
136+
help: hint: consider borrowing here:
137+
|
138+
LL | g1(|_: &(), _: ()| {});
139+
| ~~~
96140

97141
error[E0631]: type mismatch in closure arguments
98142
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@@ -109,6 +153,10 @@ note: required by a bound in `g2`
109153
|
110154
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
111155
| ^^^^^^^^^^^^^^^^ required by this bound in `g2`
156+
help: hint: consider borrowing here:
157+
|
158+
LL | g2(|_: &(), _: ()| {});
159+
| ~~~
112160

113161
error[E0631]: type mismatch in closure arguments
114162
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
@@ -125,6 +173,10 @@ note: required by a bound in `g3`
125173
|
126174
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
127175
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
176+
help: hint: consider borrowing here:
177+
|
178+
LL | g3(|_: &'s (), _: ()| {});
179+
| ~~~~~~
128180

129181
error[E0631]: type mismatch in closure arguments
130182
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@@ -141,6 +193,10 @@ note: required by a bound in `g4`
141193
|
142194
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
143195
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
196+
help: hint: consider borrowing here:
197+
|
198+
LL | g4(|_: &(), _: ()| {});
199+
| ~~~
144200

145201
error[E0631]: type mismatch in closure arguments
146202
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
@@ -157,6 +213,14 @@ note: required by a bound in `h1`
157213
|
158214
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
159215
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
216+
help: hint: consider borrowing here:
217+
|
218+
LL | h1(|_: &(), _: (), _: (), _: ()| {});
219+
| ~~~
220+
help: hint: consider borrowing here:
221+
|
222+
LL | h1(|_: (), _: (), _: &(), _: ()| {});
223+
| ~~~
160224

161225
error[E0631]: type mismatch in closure arguments
162226
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -173,6 +237,14 @@ note: required by a bound in `h2`
173237
|
174238
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
175239
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
240+
help: hint: consider borrowing here:
241+
|
242+
LL | h2(|_: &(), _: (), _: (), _: ()| {});
243+
| ~~~
244+
help: hint: consider borrowing here:
245+
|
246+
LL | h2(|_: (), _: (), _: &'t0 (), _: ()| {});
247+
| ~~~~~~~
176248

177249
error: aborting due to 11 previous errors
178250

src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ note: required by a bound in `map`
1313
|
1414
LL | F: FnMut(Self::Item) -> B,
1515
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
16+
help: hint: consider borrowing here:
17+
|
18+
LL | a.iter().map(|_: &(u32, u32)| 45);
19+
| ~~~~~~~~~~~
1620

1721
error[E0631]: type mismatch in closure arguments
1822
--> $DIR/closure-arg-type-mismatch.rs:4:14

src/test/ui/mismatched_types/issue-36053-2.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ note: required by a bound in `filter`
1313
|
1414
LL | P: FnMut(&Self::Item) -> bool,
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::filter`
16+
help: hint: consider borrowing here:
17+
|
18+
LL | once::<&str>("str").fuse().filter(|a: &&str| true).count();
19+
| ~~~~~
1620

1721
error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
1822
--> $DIR/issue-36053-2.rs:7:55

0 commit comments

Comments
 (0)