Skip to content

Commit f44ee8f

Browse files
committed
add test for 88421 ICE: could not fully normalize `&<MyType as std::ops::Index<MyType>>::Output
Fixes #88421
1 parent 74ca981 commit f44ee8f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//@ check-pass
2+
3+
#![feature(adt_const_params)]
4+
#![feature(generic_const_exprs)]
5+
#![allow(incomplete_features)]
6+
7+
use std::ops::Index;
8+
9+
pub struct CellPossibilities;
10+
11+
pub enum CellState<const SQUARE_SIZE: usize> {
12+
Empty(Option<CellPossibilities>),
13+
}
14+
15+
pub struct Sudoku<const SQUARE_SIZE: usize>;
16+
17+
impl<const SQUARE_SIZE: usize> Sudoku<SQUARE_SIZE>where
18+
[CellState<SQUARE_SIZE>; SQUARE_SIZE * SQUARE_SIZE]: Sized,
19+
{
20+
pub fn random() {
21+
let CellState::Empty(_) = Self[()];
22+
}
23+
}
24+
25+
impl<const SQUARE_SIZE: usize> Index<()> for Sudoku<SQUARE_SIZE>
26+
where
27+
[CellState<SQUARE_SIZE>; SQUARE_SIZE * SQUARE_SIZE]: Sized,
28+
{
29+
type Output = CellState<SQUARE_SIZE>;
30+
31+
fn index(&self, _: ()) -> &Self::Output {
32+
todo!()
33+
}
34+
}
35+
36+
pub fn main() {}

0 commit comments

Comments
 (0)