@@ -1314,31 +1314,21 @@ fn build_generic_type_param_di_nodes<'ll, 'tcx>(
13141314 ty : Ty < ' tcx > ,
13151315) -> SmallVec < Option < & ' ll DIType > > {
13161316 if let ty:: Adt ( def, args) = * ty. kind ( ) {
1317- let generics = cx. tcx . generics_of ( def. did ( ) ) ;
1318- return get_template_parameters ( cx, generics, args) ;
1319- }
1320-
1321- return smallvec ! [ ] ;
1322- }
1323-
1324- pub ( super ) fn get_template_parameters < ' ll , ' tcx > (
1325- cx : & CodegenCx < ' ll , ' tcx > ,
1326- generics : & ty:: Generics ,
1327- args : ty:: GenericArgsRef < ' tcx > ,
1328- ) -> SmallVec < Option < & ' ll DIType > > {
1329- if args. types ( ) . next ( ) . is_some ( ) {
1330- let names = get_parameter_names ( cx, generics) ;
1331- let template_params: SmallVec < _ > = iter:: zip ( args, names)
1332- . filter_map ( |( kind, name) | {
1333- kind. as_type ( ) . map ( |ty| {
1334- let actual_type = cx. tcx . normalize_erasing_regions ( cx. typing_env ( ) , ty) ;
1335- let actual_type_di_node = type_di_node ( cx, actual_type) ;
1336- Some ( cx. create_template_type_parameter ( name. as_str ( ) , actual_type_di_node) )
1317+ if args. types ( ) . next ( ) . is_some ( ) {
1318+ let generics = cx. tcx . generics_of ( def. did ( ) ) ;
1319+ let names = get_parameter_names ( cx, generics) ;
1320+ let template_params: SmallVec < _ > = iter:: zip ( args, names)
1321+ . filter_map ( |( kind, name) | {
1322+ kind. as_type ( ) . map ( |ty| {
1323+ let actual_type = cx. tcx . normalize_erasing_regions ( cx. typing_env ( ) , ty) ;
1324+ let actual_type_di_node = type_di_node ( cx, actual_type) ;
1325+ Some ( cx. create_template_type_parameter ( name. as_str ( ) , actual_type_di_node) )
1326+ } )
13371327 } )
1338- } )
1339- . collect ( ) ;
1328+ . collect ( ) ;
13401329
1341- return template_params;
1330+ return template_params;
1331+ }
13421332 }
13431333
13441334 return smallvec ! [ ] ;
0 commit comments