File: associated-types-binding-to-type-defined-in-supertrait.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (41 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:19
   |
LL | fn b() { blue_car(ModelT); }
   |          -------- ^^^^^^ type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
   |          |
   |          required by a bound introduced by this call
   |
note: expected this to be `Blue`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:16:40
   |
LL | impl Vehicle for ModelT { type Color = Black; }
   |                                        ^^^^^
note: required by a bound in `blue_car`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:27:19
   |
LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
   |                   ^^^^^^^^^^ required by this bound in `blue_car`

error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:20
   |
LL | fn c() { black_car(ModelU); }
   |          --------- ^^^^^^ type mismatch resolving `<ModelU as Vehicle>::Color == Black`
   |          |
   |          required by a bound introduced by this call
   |
note: expected this to be `Black`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:21:40
   |
LL | impl Vehicle for ModelU { type Color = Blue; }
   |                                        ^^^^
note: required by a bound in `black_car`
  --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:24:20
   |
LL | fn black_car<C:Car<Color=Black>>(c: C) {
   |                    ^^^^^^^^^^^ required by this bound in `black_car`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.