mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
add test for 88421 ICE: could not fully normalize `&<MyType as std::ops::Index<MyType>>::Output
Fixes #88421
This commit is contained in:
parent
74ca9813ed
commit
f44ee8f87d
@ -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() {}
|
Loading…
Reference in New Issue
Block a user