@@ -5,12 +5,10 @@ use rustc_codegen_ssa::debuginfo::type_names::{compute_debuginfo_type_name, cpp_
5
5
use rustc_codegen_ssa:: debuginfo:: { tag_base_type, wants_c_like_enum_debuginfo} ;
6
6
use rustc_codegen_ssa:: traits:: MiscCodegenMethods ;
7
7
use rustc_hir:: def:: CtorKind ;
8
- use rustc_index:: IndexSlice ;
9
8
use rustc_middle:: bug;
10
9
use rustc_middle:: mir:: CoroutineLayout ;
11
10
use rustc_middle:: ty:: layout:: { LayoutOf , TyAndLayout } ;
12
11
use rustc_middle:: ty:: { self , AdtDef , CoroutineArgs , CoroutineArgsExt , Ty , VariantDef } ;
13
- use rustc_span:: Symbol ;
14
12
15
13
use super :: type_map:: { DINodeCreationResult , UniqueTypeId } ;
16
14
use super :: { SmallVec , size_and_align_of} ;
@@ -286,7 +284,6 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
286
284
coroutine_type_and_layout : TyAndLayout < ' tcx > ,
287
285
coroutine_type_di_node : & ' ll DIType ,
288
286
coroutine_layout : & CoroutineLayout < ' tcx > ,
289
- common_upvar_names : & IndexSlice < FieldIdx , Symbol > ,
290
287
) -> & ' ll DIType {
291
288
let variant_name = CoroutineArgs :: variant_name ( variant_index) ;
292
289
let unique_type_id = UniqueTypeId :: for_enum_variant_struct_type (
@@ -297,11 +294,6 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
297
294
298
295
let variant_layout = coroutine_type_and_layout. for_variant ( cx, variant_index) ;
299
296
300
- let coroutine_args = match coroutine_type_and_layout. ty . kind ( ) {
301
- ty:: Coroutine ( _, args) => args. as_coroutine ( ) ,
302
- _ => unreachable ! ( ) ,
303
- } ;
304
-
305
297
type_map:: build_type_with_children (
306
298
cx,
307
299
type_map:: stub (
@@ -316,7 +308,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
316
308
) ,
317
309
|cx, variant_struct_type_di_node| {
318
310
// Fields that just belong to this variant/state
319
- let state_specific_fields : SmallVec < _ > = ( 0 ..variant_layout. fields . count ( ) )
311
+ ( 0 ..variant_layout. fields . count ( ) )
320
312
. map ( |field_index| {
321
313
let coroutine_saved_local = coroutine_layout. variant_fields [ variant_index]
322
314
[ FieldIdx :: from_usize ( field_index) ] ;
@@ -339,29 +331,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
339
331
None ,
340
332
)
341
333
} )
342
- . collect ( ) ;
343
-
344
- // Fields that are common to all states
345
- let common_fields: SmallVec < _ > = coroutine_args
346
- . prefix_tys ( )
347
- . iter ( )
348
- . zip ( common_upvar_names)
349
- . enumerate ( )
350
- . map ( |( index, ( upvar_ty, upvar_name) ) | {
351
- build_field_di_node (
352
- cx,
353
- variant_struct_type_di_node,
354
- upvar_name. as_str ( ) ,
355
- cx. size_and_align_of ( upvar_ty) ,
356
- coroutine_type_and_layout. fields . offset ( index) ,
357
- DIFlags :: FlagZero ,
358
- type_di_node ( cx, upvar_ty) ,
359
- None ,
360
- )
361
- } )
362
- . collect ( ) ;
363
-
364
- state_specific_fields. into_iter ( ) . chain ( common_fields) . collect ( )
334
+ . collect ( )
365
335
} ,
366
336
|cx| build_generic_type_param_di_nodes ( cx, coroutine_type_and_layout. ty ) ,
367
337
)
0 commit comments