about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorakida31 <akida3@protonmail.com>2022-10-08 15:50:35 +0200
committerakida31 <akida3@protonmail.com>2022-12-13 16:27:21 +0100
commite50f5756aac024e5f10bf918e321afa1e671d7af (patch)
tree6e89bf2564b0a1c7bbe2200f0011f726136ddee7 /src
parent1e5d7724173c2ff16e1eacbb6b09e66daa0794e3 (diff)
downloadrust-e50f5756aac024e5f10bf918e321afa1e671d7af.tar.gz
rust-e50f5756aac024e5f10bf918e321afa1e671d7af.zip
Fix stderr of tests which have improved diagnostics
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/anonymous-higher-ranked-lifetime.stderr72
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr4
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr4
3 files changed, 80 insertions, 0 deletions
diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
index bf5f642ca82..af6ae127304 100644
--- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr
+++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
@@ -13,6 +13,14 @@ note: required by a bound in `f1`
    |
 LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
    |                         ^^^^^^^^^^^^ required by this bound in `f1`
+help: hint: consider borrowing here:
+   |
+LL |     f1(|_: &(), _: ()| {});
+   |            ~~~
+help: hint: consider borrowing here:
+   |
+LL |     f1(|_: (), _: &()| {});
+   |                   ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
@@ -29,6 +37,14 @@ note: required by a bound in `f2`
    |
 LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
+help: hint: consider borrowing here:
+   |
+LL |     f2(|_: &'a (), _: ()| {});
+   |            ~~~~~~
+help: hint: consider borrowing here:
+   |
+LL |     f2(|_: (), _: &()| {});
+   |                   ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@@ -45,6 +61,14 @@ note: required by a bound in `f3`
    |
 LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
    |                             ^^^^^^^^^^^^^^^ required by this bound in `f3`
+help: hint: consider borrowing here:
+   |
+LL |     f3(|_: &(), _: ()| {});
+   |            ~~~
+help: hint: consider borrowing here:
+   |
+LL |     f3(|_: (), _: &()| {});
+   |                   ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
@@ -61,6 +85,14 @@ note: required by a bound in `f4`
    |
 LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
+help: hint: consider borrowing here:
+   |
+LL |     f4(|_: &(), _: ()| {});
+   |            ~~~
+help: hint: consider borrowing here:
+   |
+LL |     f4(|_: (), _: &'r ()| {});
+   |                   ~~~~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@@ -77,6 +109,14 @@ note: required by a bound in `f5`
    |
 LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
+help: hint: consider borrowing here:
+   |
+LL |     f5(|_: &'r (), _: ()| {});
+   |            ~~~~~~
+help: hint: consider borrowing here:
+   |
+LL |     f5(|_: (), _: &'r ()| {});
+   |                   ~~~~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
@@ -93,6 +133,10 @@ note: required by a bound in `g1`
    |
 LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
+help: hint: consider borrowing here:
+   |
+LL |     g1(|_: &(), _: ()| {});
+   |            ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@@ -109,6 +153,10 @@ note: required by a bound in `g2`
    |
 LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
    |                         ^^^^^^^^^^^^^^^^ required by this bound in `g2`
+help: hint: consider borrowing here:
+   |
+LL |     g2(|_: &(), _: ()| {});
+   |            ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
@@ -125,6 +173,10 @@ note: required by a bound in `g3`
    |
 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
+help: hint: consider borrowing here:
+   |
+LL |     g3(|_: &'s (), _: ()| {});
+   |            ~~~~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@@ -141,6 +193,10 @@ note: required by a bound in `g4`
    |
 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
+help: hint: consider borrowing here:
+   |
+LL |     g4(|_: &(), _: ()| {});
+   |            ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
@@ -157,6 +213,14 @@ note: required by a bound in `h1`
    |
 LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
+help: hint: consider borrowing here:
+   |
+LL |     h1(|_: &(), _: (), _: (), _: ()| {});
+   |            ~~~
+help: hint: consider borrowing here:
+   |
+LL |     h1(|_: (), _: (), _: &(), _: ()| {});
+   |                          ~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -173,6 +237,14 @@ note: required by a bound in `h2`
    |
 LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
+help: hint: consider borrowing here:
+   |
+LL |     h2(|_: &(), _: (), _: (), _: ()| {});
+   |            ~~~
+help: hint: consider borrowing here:
+   |
+LL |     h2(|_: (), _: (), _: &'t0 (), _: ()| {});
+   |                          ~~~~~~~
 
 error: aborting due to 11 previous errors
 
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
index f2e2a4c7fd5..8a1a0d2440b 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
@@ -13,6 +13,10 @@ note: required by a bound in `map`
    |
 LL |         F: FnMut(Self::Item) -> B,
    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
+help: hint: consider borrowing here:
+   |
+LL |     a.iter().map(|_: &(u32, u32)| 45);
+   |                      ~~~~~~~~~~~
 
 error[E0631]: type mismatch in closure arguments
   --> $DIR/closure-arg-type-mismatch.rs:4:14
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index b3509abbf84..bbcce98f7d3 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -13,6 +13,10 @@ note: required by a bound in `filter`
    |
 LL |         P: FnMut(&Self::Item) -> bool,
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::filter`
+help: hint: consider borrowing here:
+   |
+LL |     once::<&str>("str").fuse().filter(|a: &&str| true).count();
+   |                                           ~~~~~
 
 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
   --> $DIR/issue-36053-2.rs:7:55