@@ -3,7 +3,6 @@ use rustc_codegen_ssa::debuginfo::{
33 wants_c_like_enum_debuginfo,
44} ;
55use rustc_hir:: def:: CtorKind ;
6- use rustc_index:: IndexSlice ;
76use rustc_middle:: {
87 bug,
98 mir:: CoroutineLayout ,
@@ -13,7 +12,6 @@ use rustc_middle::{
1312 AdtDef , CoroutineArgs , Ty , VariantDef ,
1413 } ,
1514} ;
16- use rustc_span:: Symbol ;
1715use rustc_target:: abi:: {
1816 FieldIdx , HasDataLayout , Integer , Primitive , TagEncoding , VariantIdx , Variants ,
1917} ;
@@ -324,7 +322,6 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
324322 coroutine_type_and_layout : TyAndLayout < ' tcx > ,
325323 coroutine_type_di_node : & ' ll DIType ,
326324 coroutine_layout : & CoroutineLayout < ' tcx > ,
327- common_upvar_names : & IndexSlice < FieldIdx , Symbol > ,
328325) -> & ' ll DIType {
329326 let variant_name = CoroutineArgs :: variant_name ( variant_index) ;
330327 let unique_type_id = UniqueTypeId :: for_enum_variant_struct_type (
@@ -335,11 +332,6 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
335332
336333 let variant_layout = coroutine_type_and_layout. for_variant ( cx, variant_index) ;
337334
338- let coroutine_args = match coroutine_type_and_layout. ty . kind ( ) {
339- ty:: Coroutine ( _, args) => args. as_coroutine ( ) ,
340- _ => unreachable ! ( ) ,
341- } ;
342-
343335 type_map:: build_type_with_children (
344336 cx,
345337 type_map:: stub (
@@ -353,7 +345,7 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
353345 ) ,
354346 |cx, variant_struct_type_di_node| {
355347 // Fields that just belong to this variant/state
356- let state_specific_fields : SmallVec < _ > = ( 0 ..variant_layout. fields . count ( ) )
348+ ( 0 ..variant_layout. fields . count ( ) )
357349 . map ( |field_index| {
358350 let coroutine_saved_local = coroutine_layout. variant_fields [ variant_index]
359351 [ FieldIdx :: from_usize ( field_index) ] ;
@@ -375,28 +367,7 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
375367 type_di_node ( cx, field_type) ,
376368 )
377369 } )
378- . collect ( ) ;
379-
380- // Fields that are common to all states
381- let common_fields: SmallVec < _ > = coroutine_args
382- . prefix_tys ( )
383- . iter ( )
384- . zip ( common_upvar_names)
385- . enumerate ( )
386- . map ( |( index, ( upvar_ty, upvar_name) ) | {
387- build_field_di_node (
388- cx,
389- variant_struct_type_di_node,
390- upvar_name. as_str ( ) ,
391- cx. size_and_align_of ( upvar_ty) ,
392- coroutine_type_and_layout. fields . offset ( index) ,
393- DIFlags :: FlagZero ,
394- type_di_node ( cx, upvar_ty) ,
395- )
396- } )
397- . collect ( ) ;
398-
399- state_specific_fields. into_iter ( ) . chain ( common_fields) . collect ( )
370+ . collect ( )
400371 } ,
401372 |cx| build_generic_type_param_di_nodes ( cx, coroutine_type_and_layout. ty ) ,
402373 )
0 commit comments