]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associate-type-bound-normalization.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associate-type-bound-normalization.rs
1 // Make sure that we normalize bounds on associated types before checking them
2 // as candidates.
3
4 // check-pass
5
6 trait Mul<T> {
7     type Output;
8 }
9
10 trait Matrix: Mul<<Self as Matrix>::Row, Output = ()> {
11     type Row;
12
13     type Transpose: Matrix<Row = Self::Row>;
14 }
15
16 fn is_mul<S, T: Mul<S, Output = ()>>() {}
17
18 fn f<T: Matrix>() {
19     // The unnormalized bound on `T::Transpose` is
20     // `Mul<<T::Transpose as Matrix>::Row` which has to be normalized to be
21     // equal to `T::Row`.
22     is_mul::<T::Row, T::Transpose>();
23 }
24
25 fn main() {}