Skip to content

Commit ef11db8

Browse files
committed
Remove unnecessary select_obligations_where_possible and redundant errors
1 parent b6494a7 commit ef11db8

12 files changed

+10
-93
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
322322
ty.kind()
323323
{
324324
self.add_required_obligations_for_hir(span, *def_id, args, hir_id);
325-
self.select_obligations_where_possible(|_| {});
326325
}
327326
self.normalize(span, ty)
328327
} else {

tests/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ trait Foo<T> {
99
fn f<T:Foo<isize>>(t: &T) {
1010
let u: <T as Foo<usize>>::Bar = t.get_bar();
1111
//~^ ERROR the trait bound `T: Foo<usize>` is not satisfied
12-
//~| ERROR the trait bound `T: Foo<usize>` is not satisfied
1312
}
1413

1514
fn main() { }

tests/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ help: consider further restricting this bound
99
LL | fn f<T:Foo<isize> + Foo<usize>>(t: &T) {
1010
| ++++++++++++
1111

12-
error[E0277]: the trait bound `T: Foo<usize>` is not satisfied
13-
--> $DIR/associated-types-invalid-trait-ref-issue-18865.rs:10:12
14-
|
15-
LL | let u: <T as Foo<usize>>::Bar = t.get_bar();
16-
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo<usize>` is not implemented for `T`
17-
|
18-
help: consider further restricting this bound
19-
|
20-
LL | fn f<T:Foo<isize> + Foo<usize>>(t: &T) {
21-
| ++++++++++++
22-
23-
error: aborting due to 2 previous errors
12+
error: aborting due to previous error
2413

2514
For more information about this error, try `rustc --explain E0277`.

tests/ui/generic-associated-types/multiple-type-params-with-unmet-bounds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ impl Trait for () {
77
fn main() {
88
let _: <() as Trait>::P<String, String>;
99
//~^ ERROR the trait bound `String: Copy` is not satisfied
10-
//~| ERROR the trait bound `String: Copy` is not satisfied
1110
}

tests/ui/generic-associated-types/multiple-type-params-with-unmet-bounds.stderr

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ note: required by a bound in `Trait::P`
1010
LL | type P<T: Copy, U: Copy>;
1111
| ^^^^ required by this bound in `Trait::P`
1212

13-
error[E0277]: the trait bound `String: Copy` is not satisfied
14-
--> $DIR/multiple-type-params-with-unmet-bounds.rs:8:12
15-
|
16-
LL | let _: <() as Trait>::P<String, String>;
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
18-
|
19-
note: required by a bound in `Trait::P`
20-
--> $DIR/multiple-type-params-with-unmet-bounds.rs:2:15
21-
|
22-
LL | type P<T: Copy, U: Copy>;
23-
| ^^^^ required by this bound in `Trait::P`
24-
25-
error: aborting due to 2 previous errors
13+
error: aborting due to previous error
2614

2715
For more information about this error, try `rustc --explain E0277`.

tests/ui/generic-associated-types/own-bound-span.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ trait D {
44
type P<T: Copy>;
55
//~^ NOTE required by this bound in `D::P`
66
//~| NOTE required by a bound in `D::P`
7-
//~| NOTE required by this bound in `D::P`
8-
//~| NOTE required by a bound in `D::P`
97
}
108

119
impl D for S {
@@ -16,6 +14,4 @@ fn main() {
1614
let _: <S as D>::P<String>;
1715
//~^ ERROR the trait bound `String: Copy` is not satisfied
1816
//~| NOTE the trait `Copy` is not implemented for `String`
19-
//~| ERROR the trait bound `String: Copy` is not satisfied
20-
//~| NOTE the trait `Copy` is not implemented for `String`
2117
}
Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `String: Copy` is not satisfied
2-
--> $DIR/own-bound-span.rs:16:24
2+
--> $DIR/own-bound-span.rs:14:24
33
|
44
LL | let _: <S as D>::P<String>;
55
| ^^^^^^ the trait `Copy` is not implemented for `String`
@@ -10,18 +10,6 @@ note: required by a bound in `D::P`
1010
LL | type P<T: Copy>;
1111
| ^^^^ required by this bound in `D::P`
1212

13-
error[E0277]: the trait bound `String: Copy` is not satisfied
14-
--> $DIR/own-bound-span.rs:16:12
15-
|
16-
LL | let _: <S as D>::P<String>;
17-
| ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
18-
|
19-
note: required by a bound in `D::P`
20-
--> $DIR/own-bound-span.rs:4:15
21-
|
22-
LL | type P<T: Copy>;
23-
| ^^^^ required by this bound in `D::P`
24-
25-
error: aborting due to 2 previous errors
13+
error: aborting due to previous error
2614

2715
For more information about this error, try `rustc --explain E0277`.

tests/ui/issues/issue-66353.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ trait _A {
1111
fn main() {
1212
_Func::< <() as _A>::AssocT >::func(());
1313
//~^ ERROR the trait bound `(): _A` is not satisfied
14-
//~| ERROR the trait bound `(): _A` is not satisfied
1514
//~| ERROR the trait bound `(): _Func<_>` is not satisfied
1615
}

tests/ui/issues/issue-66353.stderr

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ error[E0277]: the trait bound `(): _A` is not satisfied
44
LL | _Func::< <() as _A>::AssocT >::func(());
55
| ^^ the trait `_A` is not implemented for `()`
66

7-
error[E0277]: the trait bound `(): _A` is not satisfied
8-
--> $DIR/issue-66353.rs:12:14
9-
|
10-
LL | _Func::< <() as _A>::AssocT >::func(());
11-
| ^^^^^^^^^^^^^^^^^^ the trait `_A` is not implemented for `()`
12-
137
error[E0277]: the trait bound `(): _Func<_>` is not satisfied
148
--> $DIR/issue-66353.rs:12:41
159
|
@@ -18,6 +12,6 @@ LL | _Func::< <() as _A>::AssocT >::func(());
1812
| |
1913
| required by a bound introduced by this call
2014

21-
error: aborting due to 3 previous errors
15+
error: aborting due to 2 previous errors
2216

2317
For more information about this error, try `rustc --explain E0277`.

tests/ui/object-safety/assoc_type_bounds_sized_used.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fn bop<T: Bop + ?Sized>() {
1212
let _ = <T as Bop>::Bar::default();
1313
//~^ ERROR: trait bounds were not satisfied
1414
//~| ERROR: the size for values of type `T` cannot be known at compilation time
15-
//~| ERROR: the size for values of type `T` cannot be known at compilation time
1615
}
1716

1817
fn main() {

0 commit comments

Comments
 (0)