Skip to content

Commit 890de33

Browse files
committed
Fix duplicate error
1 parent af9de99 commit 890de33

File tree

5 files changed

+7
-27
lines changed

5 files changed

+7
-27
lines changed

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
5555
} = origin
5656
{
5757
self.emit_associated_type_err(span, item_name, impl_item_def_id, trait_item_def_id);
58+
return Some(ErrorReported);
5859
}
5960
}
6061
None

src/test/ui/generic-associated-types/impl_bounds.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ impl<T> Foo for Fooy<T> {
1616
//~^ ERROR the parameter type `T` may not live long enough
1717
type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
1818
//~^ ERROR `impl` associated type
19-
//~| ERROR impl has stricter
2019
//~| ERROR lifetime bound not satisfied
2120
type C where Self: Copy = String;
2221
//~^ ERROR the trait bound `T: Copy` is not satisfied

src/test/ui/generic-associated-types/impl_bounds.stderr

+5-14
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ LL | type B<'a, 'b> where 'a: 'b;
1616
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
1818

19-
error[E0276]: impl has stricter requirements than trait
20-
--> $DIR/impl_bounds.rs:17:5
21-
|
22-
LL | type B<'a, 'b> where 'a: 'b;
23-
| ---------------------------- definition of `B` from trait
24-
...
25-
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
26-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'b: 'a`
27-
2819
error[E0478]: lifetime bound not satisfied
2920
--> $DIR/impl_bounds.rs:17:5
3021
|
@@ -43,7 +34,7 @@ LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
4334
| ^^
4435

4536
error[E0277]: the trait bound `T: Copy` is not satisfied
46-
--> $DIR/impl_bounds.rs:21:5
37+
--> $DIR/impl_bounds.rs:20:5
4738
|
4839
LL | type C where Self: Copy = String;
4940
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
@@ -68,7 +59,7 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
6859
| +++++++++++++++++++
6960

7061
error[E0277]: the trait bound `T: Copy` is not satisfied
71-
--> $DIR/impl_bounds.rs:23:5
62+
--> $DIR/impl_bounds.rs:22:5
7263
|
7364
LL | fn d() where Self: Copy {}
7465
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
@@ -92,7 +83,7 @@ help: consider restricting type parameter `T`
9283
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
9384
| +++++++++++++++++++
9485

95-
error: aborting due to 6 previous errors
86+
error: aborting due to 5 previous errors
9687

97-
Some errors have detailed explanations: E0276, E0277, E0310, E0478.
98-
For more information about an error, try `rustc --explain E0276`.
88+
Some errors have detailed explanations: E0277, E0310, E0478.
89+
For more information about an error, try `rustc --explain E0277`.

src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ trait Foo {
88
impl Foo for () {
99
type Assoc<'a, 'b> where 'a: 'b = ();
1010
//~^ `impl` associated type
11-
//~| impl has stricter
1211
}
1312

1413
fn main() {}

src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr

+1-11
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,5 @@ LL | type Assoc<'a, 'b>;
77
LL | type Assoc<'a, 'b> where 'a: 'b = ();
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
99

10-
error[E0276]: impl has stricter requirements than trait
11-
--> $DIR/missing-where-clause-on-trait.rs:9:5
12-
|
13-
LL | type Assoc<'a, 'b>;
14-
| ------------------- definition of `Assoc` from trait
15-
...
16-
LL | type Assoc<'a, 'b> where 'a: 'b = ();
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
18-
19-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
2011

21-
For more information about this error, try `rustc --explain E0276`.

0 commit comments

Comments
 (0)