Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddyb

Use `PredicateObligation`s instead of `Predicate`s

Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations.

Subset of #69709.

r? @eddyb
This commit is contained in:
Mazdak Farrokhzad 2020-04-10 18:15:16 +02:00 committed by GitHub
commit 1fe86f47d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
207 changed files with 547 additions and 403 deletions

View file

@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
--> $DIR/E0271.rs:10:5
|
LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
| --- ------------------ required by this bound in `foo`
| ------------------ required by this bound in `foo`
...
LL | foo(3_i8);
| ^^^ expected `u32`, found `&str`

View file

@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<B
--> $DIR/E0275.rs:5:33
|
LL | trait Foo {}
| --------- required by `Foo`
| --------- required by this bound in `Foo`
...
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^

View file

@ -2,7 +2,7 @@ error[E0277]: `*const u8` cannot be sent between threads safely
--> $DIR/E0277-2.rs:16:5
|
LL | fn is_send<T: Send>() { }
| ------- ---- required by this bound in `is_send`
| ---- required by this bound in `is_send`
...
LL | is_send::<Foo>();
| ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely

View file

@ -14,7 +14,7 @@ error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/E0277.rs:17:15
|
LL | fn some_func<T: Foo>(foo: T) {
| --------- --- required by this bound in `some_func`
| --- required by this bound in `some_func`
...
LL | some_func(5i32);
| ^^^^ the trait `Foo` is not implemented for `i32`