diff --git a/tests/ui/const-generics/generic_const_exprs/failed-to-normalize-ice-issue-88421.rs b/tests/ui/const-generics/generic_const_exprs/failed-to-normalize-ice-issue-88421.rs new file mode 100644 index 0000000000000..2ea7394fb72a5 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/failed-to-normalize-ice-issue-88421.rs @@ -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 { + Empty(Option), +} + +pub struct Sudoku; + +impl Sudokuwhere + [CellState; SQUARE_SIZE * SQUARE_SIZE]: Sized, +{ + pub fn random() { + let CellState::Empty(_) = Self[()]; + } +} + +impl Index<()> for Sudoku +where + [CellState; SQUARE_SIZE * SQUARE_SIZE]: Sized, +{ + type Output = CellState; + + fn index(&self, _: ()) -> &Self::Output { + todo!() + } +} + +pub fn main() {}