add test for 88421 ICE: could not fully normalize `&<MyType as std::ops::Index<MyType>>::Output

Fixes #88421
This commit is contained in:
Matthias Krüger 2024-03-22 18:29:41 +01:00
parent 74ca9813ed
commit f44ee8f87d

View File

@ -0,0 +1,36 @@
//@ check-pass
#![feature(adt_const_params)]
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
use std::ops::Index;
pub struct CellPossibilities;
pub enum CellState<const SQUARE_SIZE: usize> {
Empty(Option<CellPossibilities>),
}
pub struct Sudoku<const SQUARE_SIZE: usize>;
impl<const SQUARE_SIZE: usize> Sudoku<SQUARE_SIZE>where
[CellState<SQUARE_SIZE>; SQUARE_SIZE * SQUARE_SIZE]: Sized,
{
pub fn random() {
let CellState::Empty(_) = Self[()];
}
}
impl<const SQUARE_SIZE: usize> Index<()> for Sudoku<SQUARE_SIZE>
where
[CellState<SQUARE_SIZE>; SQUARE_SIZE * SQUARE_SIZE]: Sized,
{
type Output = CellState<SQUARE_SIZE>;
fn index(&self, _: ()) -> &Self::Output {
todo!()
}
}
pub fn main() {}