@@ -5,12 +5,11 @@ use rustc_codegen_ssa::debuginfo::type_names::{compute_debuginfo_type_name, cpp_
55use rustc_codegen_ssa:: debuginfo:: { tag_base_type, wants_c_like_enum_debuginfo} ;
66use rustc_codegen_ssa:: traits:: MiscCodegenMethods ;
77use rustc_hir:: def:: CtorKind ;
8- use rustc_index:: IndexSlice ;
98use rustc_middle:: bug;
109use rustc_middle:: mir:: CoroutineLayout ;
1110use rustc_middle:: ty:: layout:: { LayoutOf , TyAndLayout } ;
1211use rustc_middle:: ty:: { self , AdtDef , CoroutineArgs , CoroutineArgsExt , Ty , VariantDef } ;
13- use rustc_span:: { Span , Symbol } ;
12+ use rustc_span:: Span ;
1413
1514use super :: type_map:: { DINodeCreationResult , UniqueTypeId } ;
1615use super :: { SmallVec , size_and_align_of} ;
@@ -287,7 +286,6 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
287286 coroutine_type_and_layout : TyAndLayout < ' tcx > ,
288287 coroutine_type_di_node : & ' ll DIType ,
289288 coroutine_layout : & CoroutineLayout < ' tcx > ,
290- common_upvar_names : & IndexSlice < FieldIdx , Symbol > ,
291289) -> & ' ll DIType {
292290 let variant_name = CoroutineArgs :: variant_name ( variant_index) ;
293291 let unique_type_id = UniqueTypeId :: for_enum_variant_struct_type (
@@ -298,11 +296,6 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
298296
299297 let variant_layout = coroutine_type_and_layout. for_variant ( cx, variant_index) ;
300298
301- let coroutine_args = match coroutine_type_and_layout. ty . kind ( ) {
302- ty:: Coroutine ( _, args) => args. as_coroutine ( ) ,
303- _ => unreachable ! ( ) ,
304- } ;
305-
306299 type_map:: build_type_with_children (
307300 cx,
308301 type_map:: stub (
@@ -317,7 +310,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
317310 ) ,
318311 |cx, variant_struct_type_di_node| {
319312 // Fields that just belong to this variant/state
320- let state_specific_fields : SmallVec < _ > = ( 0 ..variant_layout. fields . count ( ) )
313+ ( 0 ..variant_layout. fields . count ( ) )
321314 . map ( |field_index| {
322315 let coroutine_saved_local = coroutine_layout. variant_fields [ variant_index]
323316 [ FieldIdx :: from_usize ( field_index) ] ;
@@ -340,29 +333,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
340333 None ,
341334 )
342335 } )
343- . collect ( ) ;
344-
345- // Fields that are common to all states
346- let common_fields: SmallVec < _ > = coroutine_args
347- . prefix_tys ( )
348- . iter ( )
349- . zip ( common_upvar_names)
350- . enumerate ( )
351- . map ( |( index, ( upvar_ty, upvar_name) ) | {
352- build_field_di_node (
353- cx,
354- variant_struct_type_di_node,
355- upvar_name. as_str ( ) ,
356- cx. layout_of ( upvar_ty) ,
357- coroutine_type_and_layout. fields . offset ( index) ,
358- DIFlags :: FlagZero ,
359- type_di_node ( cx, upvar_ty) ,
360- None ,
361- )
362- } )
363- . collect ( ) ;
364-
365- state_specific_fields. into_iter ( ) . chain ( common_fields) . collect ( )
336+ . collect ( )
366337 } ,
367338 |cx| build_generic_type_param_di_nodes ( cx, coroutine_type_and_layout. ty ) ,
368339 )
0 commit comments