Add regression test for recursive lazy type alias normalization ICE

Exercises a self-referencing type alias with lazy_type_alias and
min_generic_const_args, which previously caused an ICE during
normalization.
This commit is contained in:
Jean IBARZ
2026-03-29 14:15:57 +02:00
parent fb27476aaf
commit 9fd2c9ef01
2 changed files with 25 additions and 0 deletions
@@ -0,0 +1,14 @@
//! Ensure a self-referencing lazy type alias with `min_generic_const_args`
//! doesn't ICE during normalization.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/152633>.
#![feature(lazy_type_alias)]
#![feature(min_generic_const_args)]
trait Trait {
type const ASSOC: ();
}
type Arr2 = [usize; <Arr2 as Trait>::ASSOC]; //~ ERROR E0275
fn main() {}
@@ -0,0 +1,11 @@
error[E0275]: overflow normalizing the type alias `Arr2`
--> $DIR/recursive-lazy-type-alias-ice-152633.rs:12:1
|
LL | type Arr2 = [usize; <Arr2 as Trait>::ASSOC];
| ^^^^^^^^^
|
= note: in case this is a recursive type alias, consider using a struct, enum, or union instead
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0275`.