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

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/unsized-enum.rs:6:36
|
LL | enum Foo<U> { FooSome(U), FooNone }
| ----------- required by `Foo`
| --- - required by this bound in `Foo`
LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized-inherent-impl-self-type.rs:7:17
|
LL | struct S5<Y>(Y);
| ---------------- required by `S5`
| -- - required by this bound in `S5`
LL |
LL | impl<X: ?Sized> S5<X> {
| - ^^^^^ doesn't have a size known at compile-time

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/unsized-struct.rs:6:36
|
LL | struct Foo<T> { data: T }
| ------------- required by `Foo`
| --- - required by this bound in `Foo`
LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized-trait-impl-self-type.rs:10:17
|
LL | struct S5<Y>(Y);
| ---------------- required by `S5`
| -- - required by this bound in `S5`
LL |
LL | impl<X: ?Sized> T3<X> for S5<X> {
| - ^^^^^ doesn't have a size known at compile-time