]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr
Remove `AssocTypeBound` and propagate bound `Span`s
[rust.git] / src / test / ui / suggestions / missing-assoc-type-bound-restriction.stderr
1 error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied
2   --> $DIR/missing-assoc-type-bound-restriction.rs:17:19
3    |
4 LL | trait Parent {
5    |       ------
6 LL |     type Ty;
7 LL |     type Assoc: Child<Self::Ty>;
8    |                 --------------- required by this bound in `Parent`
9 ...
10 LL | impl<A, T: Parent<Ty = A>> Parent for ParentWrapper<T> {
11    |                   ^^^^^^                              - help: consider further restricting the associated type: `where <T as Parent>::Assoc: Child<A>`
12    |                   |
13    |                   the trait `Child<A>` is not implemented for `<T as Parent>::Assoc`
14
15 error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied
16   --> $DIR/missing-assoc-type-bound-restriction.rs:20:18
17    |
18 LL | trait Parent {
19    |       ------
20 LL |     type Ty;
21 LL |     type Assoc: Child<Self::Ty>;
22    |                 --------------- required by this bound in `Parent`
23 ...
24 LL | impl<A, T: Parent<Ty = A>> Parent for ParentWrapper<T> {
25    |                                                       - help: consider further restricting the associated type: `where <T as Parent>::Assoc: Child<A>`
26 ...
27 LL |     type Assoc = ChildWrapper<T::Assoc>;
28    |                  ^^^^^^^^^^^^^^^^^^^^^^ the trait `Child<A>` is not implemented for `<T as Parent>::Assoc`
29    |
30    = note: required because of the requirements on the impl of `Child<A>` for `ChildWrapper<<T as Parent>::Assoc>`
31    = note: required because of the requirements on the impl of `Child<<ParentWrapper<T> as Parent>::Ty>` for `<ParentWrapper<T> as Parent>::Assoc`
32
33 error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied
34   --> $DIR/missing-assoc-type-bound-restriction.rs:20:5
35    |
36 LL | trait Parent {
37    |       ------
38 LL |     type Ty;
39 LL |     type Assoc: Child<Self::Ty>;
40    |                 --------------- required by this bound in `Parent`
41 ...
42 LL | impl<A, T: Parent<Ty = A>> Parent for ParentWrapper<T> {
43    |                                                       - help: consider further restricting the associated type: `where <T as Parent>::Assoc: Child<A>`
44 ...
45 LL |     type Assoc = ChildWrapper<T::Assoc>;
46    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Child<A>` is not implemented for `<T as Parent>::Assoc`
47
48 error: aborting due to 3 previous errors
49
50 For more information about this error, try `rustc --explain E0277`.