mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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`.
|
||||
Reference in New Issue
Block a user