]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/missing-associated-types.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / missing-associated-types.rs
1 use std::ops::{Add, Sub, Mul, Div};
2 trait X<Rhs>: Mul<Rhs> + Div<Rhs> {}
3 trait Y<Rhs>: Div<Rhs, Output = Rhs> {
4     type A;
5 }
6 trait Z<Rhs>: Div<Rhs> {
7     type A;
8     type B;
9 }
10 trait Fine<Rhs>: Div<Rhs, Output = Rhs> {}
11
12 type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>;
13 //~^ ERROR only auto traits can be used as additional traits in a trait object
14 //~| ERROR the value of the associated types
15 type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>;
16 //~^ ERROR only auto traits can be used as additional traits in a trait object
17 //~| ERROR the value of the associated types
18 type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>;
19 //~^ ERROR only auto traits can be used as additional traits in a trait object
20 //~| ERROR the value of the associated types
21 type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
22 //~^ ERROR only auto traits can be used as additional traits in a trait object
23 //~| ERROR the value of the associated types
24 type Bal<Rhs> = dyn X<Rhs>;
25 //~^ ERROR the value of the associated types
26
27 fn main() {}