]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/issue-37883.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / associated-types / issue-37883.rs
1 // check-pass
2
3 use std::ops::Mul;
4
5 fn main() {}
6
7 trait Ring {}
8 trait Real: Ring {}
9
10 trait Module: Sized + Mul<<Self as Module>::Ring, Output = Self> {
11     type Ring: Ring;
12 }
13
14 trait EuclideanSpace {
15     type Coordinates: Module<Ring = Self::Real>;
16     type Real: Real;
17 }
18
19 trait Translation<E: EuclideanSpace> {
20     fn to_vector(&self) -> E::Coordinates;
21
22     fn powf(&self, n: <E::Coordinates as Module>::Ring) -> E::Coordinates {
23         self.to_vector() * n
24     }
25 }