// run-pass use std::marker::PhantomData; fn main() { let _arr = [1; >::VAL]; } trait TypeVal { const VAL: T; } struct Five; impl TypeVal for Five { const VAL: usize = 5; } struct Multiply { _n: PhantomData, _m: PhantomData, } impl TypeVal for Multiply where N: TypeVal, M: TypeVal, { const VAL: usize = N::VAL * M::VAL; }