summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr
blob: e765f932398411b5f099d018fbd89195bb6aeb5b (plain)
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:46
   |
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:37
   |
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` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:30
   |
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` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
  --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
   |
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`.