about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-16 10:07:58 +0000
committerbors <bors@rust-lang.org>2017-06-16 10:07:58 +0000
commit787d9da1253da6351dd8edbef4aef23c3f26f475 (patch)
tree6abbd4cc5f8b22db4fe225b67a82b71d79b4aeb5 /src/test/ui
parentc3627e25ee275323ff224bfd7c0fd0bc1362c28d (diff)
parent7b9519a5d47879c37f0ac6871cee2e1cb8eca1cc (diff)
downloadrust-787d9da1253da6351dd8edbef4aef23c3f26f475.tar.gz
rust-787d9da1253da6351dd8edbef4aef23c3f26f475.zip
Auto merge of #41840 - arielb1:deduplicate-selection-errors, r=nikomatsakis
Suppress trait errors that are implied by other errors

this is currently a hack and should be cleaned up somewhat. Posting this to get some feedback.

r? @nikomatsakis
cc @estebank
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/mismatched_types/E0281.stderr11
-rw-r--r--src/test/ui/mismatched_types/binops.stderr8
-rw-r--r--src/test/ui/mismatched_types/closure-arg-count.stderr24
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr9
-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.stderr14
-rw-r--r--src/test/ui/type-check/issue-40294.stderr6
7 files changed, 4 insertions, 69 deletions
diff --git a/src/test/ui/mismatched_types/E0281.stderr b/src/test/ui/mismatched_types/E0281.stderr
index fab48e9a740..3eb5c125789 100644
--- a/src/test/ui/mismatched_types/E0281.stderr
+++ b/src/test/ui/mismatched_types/E0281.stderr
@@ -9,16 +9,5 @@ error[E0281]: type mismatch: `[closure@$DIR/E0281.rs:14:9: 14:24]` implements th
    |
    = note: required by `foo`
 
-error[E0281]: type mismatch: `[closure@$DIR/E0281.rs:14:9: 14:24]` implements the trait `std::ops::FnOnce<(std::string::String,)>`, but the trait `std::ops::FnOnce<(usize,)>` is required
-  --> $DIR/E0281.rs:14:5
-   |
-14 |     foo(|y: String| { });
-   |     ^^^ --------------- implements `std::ops::FnOnce<(std::string::String,)>`
-   |     |
-   |     requires `std::ops::FnOnce<(usize,)>`
-   |     expected usize, found struct `std::string::String`
-   |
-   = note: required by `foo`
-
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/mismatched_types/binops.stderr b/src/test/ui/mismatched_types/binops.stderr
index 1faf72cd760..cebdc12f568 100644
--- a/src/test/ui/mismatched_types/binops.stderr
+++ b/src/test/ui/mismatched_types/binops.stderr
@@ -30,14 +30,6 @@ error[E0277]: the trait bound `{integer}: std::ops::Div<&str>` is not satisfied
    |
    = help: the trait `std::ops::Div<&str>` is not implemented for `{integer}`
 
-error[E0277]: the trait bound `{integer}: std::cmp::PartialEq<std::string::String>` is not satisfied
-  --> $DIR/binops.rs:16:7
-   |
-16 |     5 < String::new();
-   |       ^ can't compare `{integer}` with `std::string::String`
-   |
-   = help: the trait `std::cmp::PartialEq<std::string::String>` is not implemented for `{integer}`
-
 error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd<std::string::String>` is not satisfied
   --> $DIR/binops.rs:16:7
    |
diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr
index cd16e5d70b6..85734dfac70 100644
--- a/src/test/ui/mismatched_types/closure-arg-count.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-count.stderr
@@ -6,22 +6,6 @@ error[E0593]: closure takes 0 arguments but 2 arguments are required
    |               |
    |               expected closure that takes 2 arguments
 
-error[E0593]: closure takes 0 arguments but 2 arguments are required
-  --> $DIR/closure-arg-count.rs:12:15
-   |
-12 |     [1, 2, 3].sort_by(|| panic!());
-   |               ^^^^^^^ ----------- takes 0 arguments
-   |               |
-   |               expected closure that takes 2 arguments
-
-error[E0593]: closure takes 1 argument but 2 arguments are required
-  --> $DIR/closure-arg-count.rs:13:15
-   |
-13 |     [1, 2, 3].sort_by(|tuple| panic!());
-   |               ^^^^^^^ ---------------- takes 1 argument
-   |               |
-   |               expected closure that takes 2 arguments
-
 error[E0593]: closure takes 1 argument but 2 arguments are required
   --> $DIR/closure-arg-count.rs:13:15
    |
@@ -47,13 +31,5 @@ error[E0593]: closure takes 1 argument but 2 arguments are required
    |               |
    |               expected closure that takes 2 arguments
 
-error[E0593]: closure takes 1 argument but 2 arguments are required
-  --> $DIR/closure-arg-count.rs:14:15
-   |
-14 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
-   |               ^^^^^^^ -------------------------- takes 1 argument
-   |               |
-   |               expected closure that takes 2 arguments
-
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index 8b756814ced..f818bd8bcb1 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -17,14 +17,5 @@ error[E0281]: type mismatch: `[closure@$DIR/issue-36053-2.rs:17:39: 17:53]` impl
    |                                requires `for<'r> std::ops::FnMut<(&'r &str,)>`
    |                                expected &str, found str
 
-error[E0281]: type mismatch: `[closure@$DIR/issue-36053-2.rs:17:39: 17:53]` implements the trait `for<'r> std::ops::FnOnce<(&'r str,)>`, but the trait `for<'r> std::ops::FnOnce<(&'r &str,)>` is required
-  --> $DIR/issue-36053-2.rs:17:32
-   |
-17 |     once::<&str>("str").fuse().filter(|a: &str| true).count();
-   |                                ^^^^^^ -------------- implements `for<'r> std::ops::FnOnce<(&'r str,)>`
-   |                                |
-   |                                requires `for<'r> std::ops::FnOnce<(&'r &str,)>`
-   |                                expected &str, found str
-
 error: aborting due to previous error(s)
 
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 7400a27fb6b..693a1585320 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
@@ -24,7 +24,6 @@ pub fn main() {
     //~| NOTE implements
     let z = call_it(3, f);
     //~^ ERROR type mismatch
-    //~| ERROR type mismatch
     //~| NOTE expected isize, found usize
     //~| NOTE expected isize, found usize
     //~| NOTE requires
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 c5bfb6e45e7..643c9b36dbd 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
@@ -12,19 +12,5 @@ error[E0281]: type mismatch: `[closure@$DIR/unboxed-closures-vtable-mismatch.rs:
    |
    = note: required by `call_it`
 
-error[E0281]: type mismatch: `[closure@$DIR/unboxed-closures-vtable-mismatch.rs:22:23: 22:73]` implements the trait `std::ops::FnOnce<(usize, isize)>`, but the trait `std::ops::FnOnce<(isize, isize)>` is required
-  --> $DIR/unboxed-closures-vtable-mismatch.rs:25:13
-   |
-22 |     let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
-   |                       -------------------------------------------------- implements `std::ops::FnOnce<(usize, isize)>`
-...
-25 |     let z = call_it(3, f);
-   |             ^^^^^^^
-   |             |
-   |             requires `std::ops::FnOnce<(isize, isize)>`
-   |             expected isize, found usize
-   |
-   = note: required by `call_it`
-
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/type-check/issue-40294.stderr b/src/test/ui/type-check/issue-40294.stderr
index bf03e52369f..cd474b14193 100644
--- a/src/test/ui/type-check/issue-40294.stderr
+++ b/src/test/ui/type-check/issue-40294.stderr
@@ -1,4 +1,4 @@
-error[E0282]: type annotations needed
+error[E0283]: type annotations required: cannot resolve `&'a T: Foo`
   --> $DIR/issue-40294.rs:15:1
    |
 15 | / fn foo<'a,'b,T>(x: &'a T, y: &'b T)
@@ -8,7 +8,9 @@ error[E0282]: type annotations needed
 19 | |     x.foo();
 20 | |     y.foo();
 21 | | }
-   | |_^ cannot infer type for `&'a T`
+   | |_^
+   |
+   = note: required by `Foo`
 
 error: aborting due to previous error(s)