Use PredicateObligations instead of Predicates

Keep more information about trait binding failures.
This commit is contained in:
Esteban Küber 2020-03-03 15:07:04 -08:00
parent 485c5fb6e1
commit bd7ea5441e
90 changed files with 280 additions and 141 deletions

View file

@ -13,7 +13,7 @@ error[E0277]: `dummy::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:23:5
|
LL | struct Outer<T: Send>(T);
| ------------------------- required by `Outer`
| ----- ---- required by this bound in `Outer`
...
LL | Outer(TestType);
| ^^^^^^^^^^^^^^^ `dummy::TestType` cannot be sent between threads safely

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: Foo` is not satisfied
--> $DIR/trait-alias-wf.rs:5:14
|
LL | trait A<T: Foo> {}
| --------------- required by `A`
| - --- required by this bound in `A`
LL | trait B<T> = A<T>;
| ^^^^ the trait `Foo` is not implemented for `T`
|

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `u32: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:15
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | fn explode(x: Foo<u32>) {}
| ^^^^^^^^ the trait `Trait` is not implemented for `u32`
@ -11,7 +11,7 @@ error[E0277]: the trait bound `f32: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:16:14
|
LL | enum Bar<T:Trait> {
| ----------------- required by `Bar`
| --- ----- required by this bound in `Bar`
...
LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^ the trait `Trait` is not implemented for `f32`

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `u16: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-in-impls.rs:20:6
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | impl PolyTrait<Foo<u16>> for Struct {
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u16`

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-locals.rs:15:14
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | let baz: Foo<usize> = loop { };
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-static.rs:9:11
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | static X: Foo<usize> = Foo {
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`

View file

@ -3,16 +3,22 @@ error[E0277]: the trait bound `usize: trait_bounds_on_structs_and_enums_xc::Trai
|
LL | fn explode(x: Foo<usize>) {}
| ^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `usize`
|
::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:5:18
|
= note: required by `trait_bounds_on_structs_and_enums_xc::Foo`
LL | pub struct Foo<T:Trait> {
| ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Foo`
error[E0277]: the trait bound `f32: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-xc.rs:10:14
|
LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f32`
|
::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16
|
= note: required by `trait_bounds_on_structs_and_enums_xc::Bar`
LL | pub enum Bar<T:Trait> {
| ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Bar`
error: aborting due to 2 previous errors

View file

@ -3,8 +3,11 @@ error[E0277]: the trait bound `f64: trait_bounds_on_structs_and_enums_xc::Trait`
|
LL | let bar: Bar<f64> = return;
| ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f64`
|
::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16
|
= note: required by `trait_bounds_on_structs_and_enums_xc::Bar`
LL | pub enum Bar<T:Trait> {
| ----- required by this bound in `trait_bounds_on_structs_and_enums_xc::Bar`
error[E0277]: the trait bound `{integer}: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:8:15

View file

@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:13:9
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | impl<T> Foo<T> {
| ^^^^^^ the trait `Trait` is not implemented for `T`
@ -16,7 +16,7 @@ error[E0277]: the trait bound `isize: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:19:5
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | a: Foo<isize>,
| ^^^^^^^^^^^^^ the trait `Trait` is not implemented for `isize`
@ -25,7 +25,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:23:10
|
LL | enum Bar<T:Trait> {
| ----------------- required by `Bar`
| --- ----- required by this bound in `Bar`
...
LL | Quux(Bar<usize>),
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`
@ -34,7 +34,7 @@ error[E0277]: the trait bound `U: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:27:5
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | b: Foo<U>,
| ^^^^^^^^^ the trait `Trait` is not implemented for `U`
@ -48,7 +48,7 @@ error[E0277]: the trait bound `V: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:31:21
|
LL | enum Bar<T:Trait> {
| ----------------- required by `Bar`
| --- ----- required by this bound in `Bar`
...
LL | EvenMoreBadness(Bar<V>),
| ^^^^^^ the trait `Trait` is not implemented for `V`
@ -62,7 +62,7 @@ error[E0277]: the trait bound `i32: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:35:5
|
LL | struct Foo<T:Trait> {
| ------------------- required by `Foo`
| --- ----- required by this bound in `Foo`
...
LL | Foo<i32>,
| ^^^^^^^^ the trait `Trait` is not implemented for `i32`
@ -71,7 +71,7 @@ error[E0277]: the trait bound `u8: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums.rs:39:22
|
LL | enum Bar<T:Trait> {
| ----------------- required by `Bar`
| --- ----- required by this bound in `Bar`
...
LL | DictionaryLike { field: Bar<u8> },
| ^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u8`