]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-44255.rs
Rollup merge of #105526 - Xiretza:iter-from-generator-derive, r=scottmcm
[rust.git] / tests / ui / issues / issue-44255.rs
1 // run-pass
2
3 use std::marker::PhantomData;
4
5 fn main() {
6     let _arr = [1; <Multiply<Five, Five>>::VAL];
7 }
8
9 trait TypeVal<T> {
10     const VAL: T;
11 }
12
13 struct Five;
14
15 impl TypeVal<usize> for Five {
16     const VAL: usize = 5;
17 }
18
19 struct Multiply<N, M> {
20     _n: PhantomData<N>,
21     _m: PhantomData<M>,
22 }
23
24 impl<N, M> TypeVal<usize> for Multiply<N, M>
25     where N: TypeVal<usize>,
26           M: TypeVal<usize>,
27 {
28     const VAL: usize = N::VAL * M::VAL;
29 }