about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjackh726 <jack.huey@umassmed.edu>2021-09-07 18:51:24 -0400
committerjackh726 <jack.huey@umassmed.edu>2021-09-07 18:51:24 -0400
commit890de33e4f92c449ca6f142eeb7a7ab945ae5e27 (patch)
treebdaef5ba541a67544ac105567f82871664bde0aa
parentaf9de99f1262ae0b42e9e4a7d0cf56fa1e429827 (diff)
downloadrust-890de33e4f92c449ca6f142eeb7a7ab945ae5e27.tar.gz
rust-890de33e4f92c449ca6f142eeb7a7ab945ae5e27.zip
Fix duplicate error
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs1
-rw-r--r--src/test/ui/generic-associated-types/impl_bounds.rs1
-rw-r--r--src/test/ui/generic-associated-types/impl_bounds.stderr19
-rw-r--r--src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs1
-rw-r--r--src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr12
5 files changed, 7 insertions, 27 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs
index 4d789d23091..43aa8a6efce 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs
@@ -55,6 +55,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
             } = origin
             {
                 self.emit_associated_type_err(span, item_name, impl_item_def_id, trait_item_def_id);
+                return Some(ErrorReported);
             }
         }
         None
diff --git a/src/test/ui/generic-associated-types/impl_bounds.rs b/src/test/ui/generic-associated-types/impl_bounds.rs
index 2b52483d1d6..27c135cb7cf 100644
--- a/src/test/ui/generic-associated-types/impl_bounds.rs
+++ b/src/test/ui/generic-associated-types/impl_bounds.rs
@@ -16,7 +16,6 @@ impl<T> Foo for Fooy<T> {
     //~^ ERROR the parameter type `T` may not live long enough
     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
     //~^ ERROR `impl` associated type
-    //~| ERROR impl has stricter
     //~| ERROR lifetime bound not satisfied
     type C where Self: Copy = String;
     //~^ ERROR the trait bound `T: Copy` is not satisfied
diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr
index 38c7ca7a1a1..73415e0faac 100644
--- a/src/test/ui/generic-associated-types/impl_bounds.stderr
+++ b/src/test/ui/generic-associated-types/impl_bounds.stderr
@@ -16,15 +16,6 @@ LL |     type B<'a, 'b> where 'a: 'b;
 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
 
-error[E0276]: impl has stricter requirements than trait
-  --> $DIR/impl_bounds.rs:17:5
-   |
-LL |     type B<'a, 'b> where 'a: 'b;
-   |     ---------------------------- definition of `B` from trait
-...
-LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'b: 'a`
-
 error[E0478]: lifetime bound not satisfied
   --> $DIR/impl_bounds.rs:17:5
    |
@@ -43,7 +34,7 @@ LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
    |                ^^
 
 error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/impl_bounds.rs:21:5
+  --> $DIR/impl_bounds.rs:20:5
    |
 LL |     type C where Self: Copy = String;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
@@ -68,7 +59,7 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
    |       +++++++++++++++++++
 
 error[E0277]: the trait bound `T: Copy` is not satisfied
-  --> $DIR/impl_bounds.rs:23:5
+  --> $DIR/impl_bounds.rs:22:5
    |
 LL |     fn d() where Self: Copy {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
@@ -92,7 +83,7 @@ help: consider restricting type parameter `T`
 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
    |       +++++++++++++++++++
 
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
-Some errors have detailed explanations: E0276, E0277, E0310, E0478.
-For more information about an error, try `rustc --explain E0276`.
+Some errors have detailed explanations: E0277, E0310, E0478.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
index fa846516040..ad9f2e3e4ec 100644
--- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
+++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
@@ -8,7 +8,6 @@ trait Foo {
 impl Foo for () {
     type Assoc<'a, 'b> where 'a: 'b = ();
     //~^ `impl` associated type
-    //~| impl has stricter
 }
 
 fn main() {}
diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
index d5820995002..0e183c8d69a 100644
--- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
+++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
@@ -7,15 +7,5 @@ LL |     type Assoc<'a, 'b>;
 LL |     type Assoc<'a, 'b> where 'a: 'b = ();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
 
-error[E0276]: impl has stricter requirements than trait
-  --> $DIR/missing-where-clause-on-trait.rs:9:5
-   |
-LL |     type Assoc<'a, 'b>;
-   |     ------------------- definition of `Assoc` from trait
-...
-LL |     type Assoc<'a, 'b> where 'a: 'b = ();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0276`.