@@ -106,14 +106,14 @@ fn push_debuginfo_type_name<'tcx>(
106106 ty_and_layout,
107107 & |output, visited| {
108108 push_item_name ( tcx, def. did ( ) , true , output) ;
109- push_generic_params_internal ( tcx, args, output, visited) ;
109+ push_generic_params_internal ( tcx, args, def . did ( ) , output, visited) ;
110110 } ,
111111 output,
112112 visited,
113113 ) ;
114114 } else {
115115 push_item_name ( tcx, def. did ( ) , qualified, output) ;
116- push_generic_params_internal ( tcx, args, output, visited) ;
116+ push_generic_params_internal ( tcx, args, def . did ( ) , output, visited) ;
117117 }
118118 }
119119 ty:: Tuple ( component_types) => {
@@ -237,8 +237,13 @@ fn push_debuginfo_type_name<'tcx>(
237237 let principal =
238238 tcx. normalize_erasing_late_bound_regions ( ty:: ParamEnv :: reveal_all ( ) , principal) ;
239239 push_item_name ( tcx, principal. def_id , qualified, output) ;
240- let principal_has_generic_params =
241- push_generic_params_internal ( tcx, principal. args , output, visited) ;
240+ let principal_has_generic_params = push_generic_params_internal (
241+ tcx,
242+ principal. args ,
243+ principal. def_id ,
244+ output,
245+ visited,
246+ ) ;
242247
243248 let projection_bounds: SmallVec < [ _ ; 4 ] > = trait_data
244249 . projection_bounds ( )
@@ -516,7 +521,13 @@ pub fn compute_debuginfo_vtable_name<'tcx>(
516521 tcx. normalize_erasing_late_bound_regions ( ty:: ParamEnv :: reveal_all ( ) , trait_ref) ;
517522 push_item_name ( tcx, trait_ref. def_id , true , & mut vtable_name) ;
518523 visited. clear ( ) ;
519- push_generic_params_internal ( tcx, trait_ref. args , & mut vtable_name, & mut visited) ;
524+ push_generic_params_internal (
525+ tcx,
526+ trait_ref. args ,
527+ trait_ref. def_id ,
528+ & mut vtable_name,
529+ & mut visited,
530+ ) ;
520531 } else {
521532 vtable_name. push ( '_' ) ;
522533 }
@@ -610,20 +621,20 @@ fn push_unqualified_item_name(
610621fn push_generic_params_internal < ' tcx > (
611622 tcx : TyCtxt < ' tcx > ,
612623 args : GenericArgsRef < ' tcx > ,
624+ def_id : DefId ,
613625 output : & mut String ,
614626 visited : & mut FxHashSet < Ty < ' tcx > > ,
615627) -> bool {
616- if args. non_erasable_generics ( ) . next ( ) . is_none ( ) {
628+ debug_assert_eq ! ( args, tcx. normalize_erasing_regions( ty:: ParamEnv :: reveal_all( ) , args) ) ;
629+ let mut args = args. non_erasable_generics ( tcx, def_id) . peekable ( ) ;
630+ if args. peek ( ) . is_none ( ) {
617631 return false ;
618632 }
619-
620- debug_assert_eq ! ( args, tcx. normalize_erasing_regions( ty:: ParamEnv :: reveal_all( ) , args) ) ;
621-
622633 let cpp_like_debuginfo = cpp_like_debuginfo ( tcx) ;
623634
624635 output. push ( '<' ) ;
625636
626- for type_parameter in args. non_erasable_generics ( ) {
637+ for type_parameter in args {
627638 match type_parameter {
628639 GenericArgKind :: Type ( type_parameter) => {
629640 push_debuginfo_type_name ( tcx, type_parameter, true , output, visited) ;
@@ -689,11 +700,12 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
689700pub fn push_generic_params < ' tcx > (
690701 tcx : TyCtxt < ' tcx > ,
691702 args : GenericArgsRef < ' tcx > ,
703+ def_id : DefId ,
692704 output : & mut String ,
693705) {
694706 let _prof = tcx. prof . generic_activity ( "compute_debuginfo_type_name" ) ;
695707 let mut visited = FxHashSet :: default ( ) ;
696- push_generic_params_internal ( tcx, args, output, & mut visited) ;
708+ push_generic_params_internal ( tcx, args, def_id , output, & mut visited) ;
697709}
698710
699711fn push_closure_or_generator_name < ' tcx > (
@@ -736,7 +748,7 @@ fn push_closure_or_generator_name<'tcx>(
736748 // Truncate the args to the length of the above generics. This will cut off
737749 // anything closure- or generator-specific.
738750 let args = args. truncate_to ( tcx, generics) ;
739- push_generic_params_internal ( tcx, args, output, visited) ;
751+ push_generic_params_internal ( tcx, args, enclosing_fn_def_id , output, visited) ;
740752}
741753
742754fn push_close_angle_bracket ( cpp_like_debuginfo : bool , output : & mut String ) {
0 commit comments