File: associated-type-projection-from-multiple-supertraits.stderr

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (100 lines) | stat: -rw-r--r-- 4,168 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
error: equality constraints are not yet supported in `where` clauses
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:47
   |
LL | fn dent_object_2<COLOR>(c: &dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not supported
   |
   = note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information

error[E0221]: ambiguous associated type `Color` in bounds of `C`
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:19:32
   |
LL |     type Color;
   |     ---------- ambiguous `Color` from `Vehicle`
...
LL |     type Color;
   |     ---------- ambiguous `Color` from `Box`
...
LL | fn dent<C:BoxCar>(c: C, color: C::Color) {
   |                                ^^^^^^^^ ambiguous associated type `Color`
   |
help: use fully-qualified syntax to disambiguate
   |
LL | fn dent<C:BoxCar>(c: C, color: <C as Vehicle>::Color) {
   |                                ~~~~~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
   |
LL | fn dent<C:BoxCar>(c: C, color: <C as Box>::Color) {
   |                                ~~~~~~~~~~~~

error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar`
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:38
   |
LL |     type Color;
   |     ---------- ambiguous `Color` from `Vehicle`
...
LL |     type Color;
   |     ---------- ambiguous `Color` from `Box`
...
LL | fn dent_object<COLOR>(c: &dyn BoxCar<Color=COLOR>) {
   |                                      ^^^^^^^^^^^ ambiguous associated type `Color`
   |
   = help: consider introducing a new type parameter `T` and adding `where` constraints:
               where
                   T: BoxCar,
                   T: Vehicle::Color = COLOR,
                   T: Box::Color = COLOR

error[E0191]: the value of the associated types `Color` in `Box`, `Color` in `Vehicle` must be specified
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:31
   |
LL |     type Color;
   |     ---------- `Vehicle::Color` defined here
...
LL |     type Color;
   |     ---------- `Box::Color` defined here
...
LL | fn dent_object<COLOR>(c: &dyn BoxCar<Color=COLOR>) {
   |                               ^^^^^^^^^^^^^^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
   |
   = help: consider introducing a new type parameter, adding `where` constraints using the fully-qualified path to the associated types

error[E0221]: ambiguous associated type `Color` in bounds of `C`
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:28:29
   |
LL |     type Color;
   |     ---------- ambiguous `Color` from `Vehicle`
...
LL |     type Color;
   |     ---------- ambiguous `Color` from `Box`
...
LL | fn paint<C:BoxCar>(c: C, d: C::Color) {
   |                             ^^^^^^^^ ambiguous associated type `Color`
   |
help: use fully-qualified syntax to disambiguate
   |
LL | fn paint<C:BoxCar>(c: C, d: <C as Vehicle>::Color) {
   |                             ~~~~~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
   |
LL | fn paint<C:BoxCar>(c: C, d: <C as Box>::Color) {
   |                             ~~~~~~~~~~~~

error[E0191]: the value of the associated types `Color` in `Box`, `Color` in `Vehicle` must be specified
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:33
   |
LL |     type Color;
   |     ---------- `Vehicle::Color` defined here
...
LL |     type Color;
   |     ---------- `Box::Color` defined here
...
LL | fn dent_object_2<COLOR>(c: &dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
   |                                 ^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
   |
   = help: consider introducing a new type parameter, adding `where` constraints using the fully-qualified path to the associated types

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0191, E0221, E0222.
For more information about an error, try `rustc --explain E0191`.