rust/tests/crashes/110630.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
623 B
Rust
Raw Normal View History

//@ known-bug: #110630
#![feature(generic_const_exprs)]
use std::ops::Mul;
pub trait Indices<const N: usize> {
const NUM_ELEMS: usize = I::NUM_ELEMS * N;
}
pub trait Concat<J> {
type Output;
}
pub struct Tensor<I: Indices<N>, const N: usize>
where
[u8; I::NUM_ELEMS]: Sized, {}
impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul<Tensor<J, N>> for Tensor<I, N>
where
I: Concat<T>,
<I as Concat<J>>::Output: Indices<N>,
[u8; I::NUM_ELEMS]: Sized,
[u8; J::NUM_ELEMS]: Sized,
[u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized,
{
type Output = Tensor<<I as Concat<J>>::Output, N>;
}