From f44ee8f87d45516e8d78b715421954b5ded0c478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 22 Mar 2024 18:29:41 +0100 Subject: [PATCH] add test for 88421 ICE: could not fully normalize `&>::Output Fixes #88421 --- .../failed-to-normalize-ice-issue-88421.rs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/ui/const-generics/generic_const_exprs/failed-to-normalize-ice-issue-88421.rs 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 00000000000..2ea7394fb72 --- /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() {}