diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-03-03 15:07:04 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-04-08 14:40:45 -0700 |
| commit | bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e (patch) | |
| tree | ee02aacbe98954838effb64a4d3929cec7f76be9 /src/test/ui/suggestions | |
| parent | 485c5fb6e1bf12cd11a8fac5ee94962e17cff74b (diff) | |
| download | rust-bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e.tar.gz rust-bd7ea5441ec6e447d8dae1e69de7ef4320a2aa4e.zip | |
Use `PredicateObligation`s instead of `Predicate`s
Keep more information about trait binding failures.
Diffstat (limited to 'src/test/ui/suggestions')
| -rw-r--r-- | src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr | 12 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr b/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr index 31d974ed43d..6b985edae9e 100644 --- a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr +++ b/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr @@ -2,7 +2,10 @@ error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied --> $DIR/missing-assoc-type-bound-restriction.rs:17:19 | LL | trait Parent { - | ------------ required by `Parent` + | ------ +LL | type Ty; +LL | type Assoc: Child<Self::Ty>; + | --------------- required by this bound in `Parent` ... LL | impl<A, T: Parent<Ty = A>> Parent for ParentWrapper<T> { | ^^^^^^ - help: consider further restricting the associated type: `where <T as Parent>::Assoc: Child<A>` @@ -29,7 +32,10 @@ error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied --> $DIR/missing-assoc-type-bound-restriction.rs:20:5 | LL | trait Parent { - | ------------ required by `Parent` + | ------ +LL | type Ty; +LL | type Assoc: Child<Self::Ty>; + | --------------- required by this bound in `Parent` ... LL | impl<A, T: Parent<Ty = A>> Parent for ParentWrapper<T> { | - help: consider further restricting the associated type: `where <T as Parent>::Assoc: Child<A>` diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index 57a389cbb49..9ccddda45e2 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -12,18 +12,26 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis | LL | let fp = BufWriter::new(fp); | ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` + | + ::: $SRC_DIR/libstd/io/buffered.rs:LL:COL + | +LL | pub struct BufWriter<W: Write> { + | ----- required by this bound in `std::io::BufWriter` | = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` - = note: required by `std::io::BufWriter` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:17:14 | LL | let fp = BufWriter::new(fp); | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` + | + ::: $SRC_DIR/libstd/io/buffered.rs:LL:COL + | +LL | pub struct BufWriter<W: Write> { + | ----- required by this bound in `std::io::BufWriter` | = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` - = note: required by `std::io::BufWriter` error[E0599]: no method named `write_fmt` found for struct `std::io::BufWriter<&dyn std::io::Write>` in the current scope --> $DIR/mut-borrow-needed-by-trait.rs:22:5 |
