@@ -607,23 +607,21 @@ fn push_unqualified_item_name(
607607 } ;
608608}
609609
610- fn push_generic_params_internal < ' tcx > (
610+ fn push_generic_params_inner < ' tcx > (
611611 tcx : TyCtxt < ' tcx > ,
612- args : GenericArgsRef < ' tcx > ,
612+ args : impl Iterator < Item = GenericArgKind < ' tcx > > + ' tcx ,
613613 output : & mut String ,
614614 visited : & mut FxHashSet < Ty < ' tcx > > ,
615615) -> bool {
616- if args. non_erasable_generics ( ) . next ( ) . is_none ( ) {
616+ let mut args = args. peekable ( ) ;
617+ if args. peek ( ) . is_none ( ) {
617618 return false ;
618619 }
619-
620- debug_assert_eq ! ( args, tcx. normalize_erasing_regions( ty:: ParamEnv :: reveal_all( ) , args) ) ;
621-
622620 let cpp_like_debuginfo = cpp_like_debuginfo ( tcx) ;
623621
624622 output. push ( '<' ) ;
625623
626- for type_parameter in args. non_erasable_generics ( ) {
624+ for type_parameter in args {
627625 match type_parameter {
628626 GenericArgKind :: Type ( type_parameter) => {
629627 push_debuginfo_type_name ( tcx, type_parameter, true , output, visited) ;
@@ -642,6 +640,16 @@ fn push_generic_params_internal<'tcx>(
642640 true
643641}
644642
643+ fn push_generic_params_internal < ' tcx > (
644+ tcx : TyCtxt < ' tcx > ,
645+ args : GenericArgsRef < ' tcx > ,
646+ output : & mut String ,
647+ visited : & mut FxHashSet < Ty < ' tcx > > ,
648+ ) -> bool {
649+ debug_assert_eq ! ( args, tcx. normalize_erasing_regions( ty:: ParamEnv :: reveal_all( ) , args) ) ;
650+ push_generic_params_inner ( tcx, args. non_erasable_generics ( ) , output, visited)
651+ }
652+
645653fn push_const_param < ' tcx > ( tcx : TyCtxt < ' tcx > , ct : ty:: Const < ' tcx > , output : & mut String ) {
646654 match ct. kind ( ) {
647655 ty:: ConstKind :: Param ( param) => {
@@ -691,11 +699,12 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
691699pub fn push_generic_params < ' tcx > (
692700 tcx : TyCtxt < ' tcx > ,
693701 args : GenericArgsRef < ' tcx > ,
702+ generics : & ' tcx ty:: Generics ,
694703 output : & mut String ,
695704) {
696705 let _prof = tcx. prof . generic_activity ( "compute_debuginfo_type_name" ) ;
697706 let mut visited = FxHashSet :: default ( ) ;
698- push_generic_params_internal ( tcx, args, output, & mut visited) ;
707+ push_generic_params_inner ( tcx, args. non_erasable_generics_real ( generics ) , output, & mut visited) ;
699708}
700709
701710fn push_closure_or_generator_name < ' tcx > (
0 commit comments