@@ -3,7 +3,6 @@ use rustc_codegen_ssa::debuginfo::{
3
3
wants_c_like_enum_debuginfo,
4
4
} ;
5
5
use rustc_hir:: def:: CtorKind ;
6
- use rustc_index:: IndexSlice ;
7
6
use rustc_middle:: {
8
7
bug,
9
8
mir:: CoroutineLayout ,
@@ -13,7 +12,6 @@ use rustc_middle::{
13
12
AdtDef , CoroutineArgs , Ty , VariantDef ,
14
13
} ,
15
14
} ;
16
- use rustc_span:: Symbol ;
17
15
use rustc_target:: abi:: {
18
16
FieldIdx , HasDataLayout , Integer , Primitive , TagEncoding , VariantIdx , Variants ,
19
17
} ;
@@ -324,7 +322,6 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
324
322
coroutine_type_and_layout : TyAndLayout < ' tcx > ,
325
323
coroutine_type_di_node : & ' ll DIType ,
326
324
coroutine_layout : & CoroutineLayout < ' tcx > ,
327
- common_upvar_names : & IndexSlice < FieldIdx , Symbol > ,
328
325
) -> & ' ll DIType {
329
326
let variant_name = CoroutineArgs :: variant_name ( variant_index) ;
330
327
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>(
335
332
336
333
let variant_layout = coroutine_type_and_layout. for_variant ( cx, variant_index) ;
337
334
338
- let coroutine_args = match coroutine_type_and_layout. ty . kind ( ) {
339
- ty:: Coroutine ( _, args) => args. as_coroutine ( ) ,
340
- _ => unreachable ! ( ) ,
341
- } ;
342
-
343
335
type_map:: build_type_with_children (
344
336
cx,
345
337
type_map:: stub (
@@ -353,7 +345,7 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
353
345
) ,
354
346
|cx, variant_struct_type_di_node| {
355
347
// 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 ( ) )
357
349
. map ( |field_index| {
358
350
let coroutine_saved_local = coroutine_layout. variant_fields [ variant_index]
359
351
[ FieldIdx :: from_usize ( field_index) ] ;
@@ -375,28 +367,7 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
375
367
type_di_node ( cx, field_type) ,
376
368
)
377
369
} )
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 ( )
400
371
} ,
401
372
|cx| build_generic_type_param_di_nodes ( cx, coroutine_type_and_layout. ty ) ,
402
373
)
0 commit comments