Skip to content
Permalink
Browse files

Add a test for #44255

  • Loading branch information...
varkor committed Feb 25, 2019
1 parent 3f16518 commit ec56d6e5b95a88314af608756f54b4fccb16353e
Showing with 29 additions and 0 deletions.
  1. +29 −0 src/test/ui/issues/issue-44255.rs
@@ -0,0 +1,29 @@
// run-pass

use std::marker::PhantomData;

fn main() {
let _arr = [1; <Multiply<Five, Five>>::VAL];
}

trait TypeVal<T> {
const VAL: T;
}

struct Five;

impl TypeVal<usize> for Five {
const VAL: usize = 5;
}

struct Multiply<N, M> {
_n: PhantomData<N>,
_m: PhantomData<M>,
}

impl<N, M> TypeVal<usize> for Multiply<N, M>
where N: TypeVal<usize>,
M: TypeVal<usize>,
{
const VAL: usize = N::VAL * M::VAL;
}

0 comments on commit ec56d6e

Please sign in to comment.
You can’t perform that action at this time.