]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-48551.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-48551.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 // Regression test for #48551. Covers a case where duplicate candidates
3 // arose during associated type projection.
4
5 use std::ops::{Mul, MulAssign};
6
7 pub trait ClosedMul<Right>: Sized + Mul<Right, Output = Self> + MulAssign<Right> {}
8 impl<T, Right> ClosedMul<Right> for T
9 where
10     T: Mul<Right, Output = T> + MulAssign<Right>,
11 {
12 }
13
14 pub trait InnerSpace: ClosedMul<<Self as InnerSpace>::Real> {
15     type Real;
16 }
17
18 pub trait FiniteDimVectorSpace: ClosedMul<<Self as FiniteDimVectorSpace>::Field> {
19     type Field;
20 }
21
22 pub trait FiniteDimInnerSpace
23     : InnerSpace + FiniteDimVectorSpace<Field = <Self as InnerSpace>::Real> {
24 }
25
26 pub trait EuclideanSpace: ClosedMul<<Self as EuclideanSpace>::Real> {
27     type Coordinates: FiniteDimInnerSpace<Real = Self::Real>
28         + Mul<Self::Real, Output = Self::Coordinates>
29         + MulAssign<Self::Real>;
30
31     type Real;
32 }
33
34 fn main() {}