File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1052,9 +1052,11 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for FreeAliasTypeExpander<'tcx> {
10521052 }
10531053
10541054 self . depth += 1 ;
1055- ensure_sufficient_stack ( || {
1055+ let ty = ensure_sufficient_stack ( || {
10561056 self . tcx . type_of ( alias. def_id ) . instantiate ( self . tcx , alias. args ) . fold_with ( self )
1057- } )
1057+ } ) ;
1058+ self . depth -= 1 ;
1059+ ty
10581060 }
10591061
10601062 fn fold_const ( & mut self , ct : ty:: Const < ' tcx > ) -> ty:: Const < ' tcx > {
Original file line number Diff line number Diff line change 1+ // In several type analysis passes we employ a specialized expansion procedure.
2+ // This procedure used to incorrectly track expansion depth (growing much faster
3+ // than normalization depth) resulting in its internal assertion triggering.
4+ //
5+ // issue: <https://github.com/rust-lang/rust/issues/142419>
6+ //@ check-pass
7+ #![ feature( lazy_type_alias) ]
8+ #![ expect( incomplete_features) ]
9+
10+ type T0 = ( T1 , T1 , T1 , T1 ) ;
11+ type T1 = ( T2 , T2 , T2 , T2 ) ;
12+ type T2 = ( T3 , T3 , T3 , T3 ) ;
13+ type T3 = ( T4 , T4 , T4 , T4 ) ;
14+ type T4 = ( T5 , T5 , T5 , T5 ) ;
15+ type T5 = ( T6 , T6 , T6 , T6 ) ;
16+ type T6 = ( T7 , T7 , T7 , T7 ) ;
17+ type T7 = ( ) ;
18+
19+ fn accept ( _: T0 ) { }
20+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments