about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-08-18 13:27:08 +0000
committerMichael Goulet <michael@errs.io>2022-08-21 02:35:11 +0000
commit5212ac9dac4c99714ca7379f7882109fb1f07405 (patch)
tree9e3dfbb6d98fffb536621143361312a3961d8c36 /src/test
parentd2f54b1990c916c1af15124ce45dbdaa9758f7b2 (diff)
Make check for overlapping closure span more accurate
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/issues/issue-69683.stderr28
-rw-r--r--src/test/ui/mismatched_types/closure-arg-count.stderr6
-rw-r--r--src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs1
-rw-r--r--src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr6
-rw-r--r--src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr6
5 files changed, 12 insertions, 35 deletions
diff --git a/src/test/ui/issues/issue-69683.stderr b/src/test/ui/issues/issue-69683.stderr
index 248fb75b4c4..193de1a35cf 100644
--- a/src/test/ui/issues/issue-69683.stderr
+++ b/src/test/ui/issues/issue-69683.stderr
@@ -37,33 +37,7 @@ help: try using a fully qualified path to specify the expected types
 LL |     <u16 as Foo<I>>::foo(0u16, b);
    |     +++++++++++++++++++++    ~
 
-error[E0283]: type annotations needed
-  --> $DIR/issue-69683.rs:30:10
-   |
-LL |     0u16.foo(b);
-   |     ---- ^^^
-   |     |
-   |     type must be known at this point
-   |
-note: multiple `impl`s satisfying `u8: Element<_>` found
-  --> $DIR/issue-69683.rs:5:1
-   |
-LL | impl<T> Element<()> for T {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL | impl<T: Element<S>, S> Element<[S; 3]> for T {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required for `u16` to implement `Foo<_>`
-  --> $DIR/issue-69683.rs:20:9
-   |
-LL | impl<I> Foo<I> for u16
-   |         ^^^^^^     ^^^
-help: try using a fully qualified path to specify the expected types
-   |
-LL |     <u16 as Foo<I>>::foo(0u16, b);
-   |     +++++++++++++++++++++    ~
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0283, E0284.
 For more information about an error, try `rustc --explain E0283`.
diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr
index a6ed22781e9..a02ec819838 100644
--- a/src/test/ui/mismatched_types/closure-arg-count.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-count.stderr
@@ -133,12 +133,14 @@ LL |         F: FnMut(Self::Item) -> B,
    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
 
 error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
-  --> $DIR/closure-arg-count.rs:27:53
+  --> $DIR/closure-arg-count.rs:27:57
    |
 LL |     let bar = |i, x, y| i;
    |               --------- takes 3 distinct arguments
 LL |     let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
-   |                                                     ^^^ expected closure that takes a single 2-tuple as argument
+   |                                                     --- ^^^ expected closure that takes a single 2-tuple as argument
+   |                                                     |
+   |                                                     required by a bound introduced by this call
    |
 note: required by a bound in `map`
   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
index 0d64ded215a..8dbe3472ea8 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
@@ -17,5 +17,6 @@ pub fn main() {
     //~^ ERROR type mismatch
     //~| NOTE expected due to this
     //~| NOTE expected closure signature `fn(isize, _) -> _`
+    //~| NOTE required by a bound introduced by this call
     println!("{}", z);
 }
diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
index 0b0d9f10786..54b22006527 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
@@ -1,11 +1,13 @@
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/unboxed-closures-vtable-mismatch.rs:16:13
+  --> $DIR/unboxed-closures-vtable-mismatch.rs:16:24
    |
 LL |     let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
    |                       ----------------------------- found signature defined here
 LL |
 LL |     let z = call_it(3, f);
-   |             ^^^^^^^ expected due to this
+   |             -------    ^ expected due to this
+   |             |
+   |             required by a bound introduced by this call
    |
    = note: expected closure signature `fn(isize, _) -> _`
               found closure signature `fn(usize, _) -> _`
diff --git a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr
index d8e9776bb00..9a24fb8c2be 100644
--- a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr
+++ b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr
@@ -1,10 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/non-tupled-arg-mismatch.rs:6:7
+  --> $DIR/non-tupled-arg-mismatch.rs:6:5
    |
 LL |     a(|_: usize| {});
-   |     - ^^^^^^^^^^^^^ types differ
-   |     |
-   |     required by a bound introduced by this call
+   |     ^ types differ
    |
    = note: expected trait `Fn<usize>`
               found trait `Fn<(usize,)>`