]> git.proxmox.com Git - rustc.git/blame - src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / associated-types / associated-type-projection-from-multiple-supertraits.rs
CommitLineData
1a4d82fc
JJ
1// Test equality constraints in a where clause where the type being
2// equated appears in a supertrait.
3
4pub trait Vehicle {
5 type Color;
6
7 fn go(&self) { }
8}
9
10pub trait Box {
11 type Color;
c30ab7b3 12 //
1a4d82fc
JJ
13 fn mail(&self) { }
14}
15
16pub trait BoxCar : Box + Vehicle {
17}
18
19fn dent<C:BoxCar>(c: C, color: C::Color) {
20 //~^ ERROR ambiguous associated type `Color` in bounds of `C`
1a4d82fc
JJ
21}
22
dc9dc135 23fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
1a4d82fc 24 //~^ ERROR ambiguous associated type
dfeec247 25 //~| ERROR the value of the associated types
1a4d82fc
JJ
26}
27
28fn paint<C:BoxCar>(c: C, d: C::Color) {
29 //~^ ERROR ambiguous associated type `Color` in bounds of `C`
1a4d82fc
JJ
30}
31
dfeec247
XL
32fn dent_object_2<COLOR>(c: dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
33 //~^ ERROR the value of the associated types
34 //~| ERROR equality constraints are not yet supported in `where` clauses
35}
36
37fn dent_object_3<X, COLOR>(c: X)
38where X: BoxCar,
39 X: Vehicle<Color = COLOR>,
40 X: Box<Color = COLOR>
41{} // OK!
42
1a4d82fc 43pub fn main() { }