Skip to content

Commit 59e6f0d

Browse files
Rollup merge of #154549 - jeanibarz:fix/add-test-152633, r=chenyukang
Add regression test for recursive lazy type alias normalization ICE Regression test for #152633. The normalization ICE with recursive lazy_type_alias + min_generic_const_args was fixed by #152040 but didn't get a test. Compiler now reports E0275 instead of crashing. Closes #152633
2 parents 883eda3 + 9fd2c9e commit 59e6f0d

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//! Ensure a self-referencing lazy type alias with `min_generic_const_args`
2+
//! doesn't ICE during normalization.
3+
//!
4+
//! Regression test for <https://github.com/rust-lang/rust/issues/152633>.
5+
6+
#![feature(lazy_type_alias)]
7+
#![feature(min_generic_const_args)]
8+
9+
trait Trait {
10+
type const ASSOC: ();
11+
}
12+
type Arr2 = [usize; <Arr2 as Trait>::ASSOC]; //~ ERROR E0275
13+
14+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0275]: overflow normalizing the type alias `Arr2`
2+
--> $DIR/recursive-lazy-type-alias-ice-152633.rs:12:1
3+
|
4+
LL | type Arr2 = [usize; <Arr2 as Trait>::ASSOC];
5+
| ^^^^^^^^^
6+
|
7+
= note: in case this is a recursive type alias, consider using a struct, enum, or union instead
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)