@@ -639,7 +639,7 @@ pub fn type_metadata<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll
639
639
AdtKind :: Struct => prepare_struct_metadata ( cx, t, unique_type_id) . finalize ( cx) ,
640
640
AdtKind :: Union => prepare_union_metadata ( cx, t, unique_type_id) . finalize ( cx) ,
641
641
AdtKind :: Enum => {
642
- prepare_enum_metadata ( cx, t, def. did , unique_type_id, vec ! [ ] ) . finalize ( cx)
642
+ prepare_enum_metadata ( cx, t, def. did ( ) , unique_type_id, vec ! [ ] ) . finalize ( cx)
643
643
}
644
644
} ,
645
645
ty:: Tuple ( tys) => {
@@ -1207,7 +1207,7 @@ fn prepare_struct_metadata<'ll, 'tcx>(
1207
1207
let struct_name = compute_debuginfo_type_name ( cx. tcx , struct_type, false ) ;
1208
1208
1209
1209
let ( struct_def_id, variant) = match struct_type. kind ( ) {
1210
- ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
1210
+ ty:: Adt ( def, _) => ( def. did ( ) , def. non_enum_variant ( ) ) ,
1211
1211
_ => bug ! ( "prepare_struct_metadata on a non-ADT" ) ,
1212
1212
} ;
1213
1213
@@ -1384,7 +1384,7 @@ fn prepare_union_metadata<'ll, 'tcx>(
1384
1384
let union_name = compute_debuginfo_type_name ( cx. tcx , union_type, false ) ;
1385
1385
1386
1386
let ( union_def_id, variant) = match union_type. kind ( ) {
1387
- ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
1387
+ ty:: Adt ( def, _) => ( def. did ( ) , def. non_enum_variant ( ) ) ,
1388
1388
_ => bug ! ( "prepare_union_metadata on a non-ADT" ) ,
1389
1389
} ;
1390
1390
@@ -1466,7 +1466,7 @@ impl<'ll, 'tcx> EnumMemberDescriptionFactory<'ll, 'tcx> {
1466
1466
} ;
1467
1467
1468
1468
let variant_info_for = |index : VariantIdx | match * self . enum_type . kind ( ) {
1469
- ty:: Adt ( adt, _) => VariantInfo :: Adt ( & adt. variants [ index] , index) ,
1469
+ ty:: Adt ( adt, _) => VariantInfo :: Adt ( & adt. variant ( index) , index) ,
1470
1470
ty:: Generator ( def_id, _, _) => {
1471
1471
let ( generator_layout, generator_saved_local_names) =
1472
1472
generator_variant_info_data. as_ref ( ) . unwrap ( ) ;
@@ -1490,7 +1490,7 @@ impl<'ll, 'tcx> EnumMemberDescriptionFactory<'ll, 'tcx> {
1490
1490
match self . layout . variants {
1491
1491
Variants :: Single { index } => {
1492
1492
if let ty:: Adt ( adt, _) = self . enum_type . kind ( ) {
1493
- if adt. variants . is_empty ( ) {
1493
+ if adt. variants ( ) . is_empty ( ) {
1494
1494
return vec ! [ ] ;
1495
1495
}
1496
1496
}
@@ -1940,7 +1940,7 @@ fn prepare_enum_metadata<'ll, 'tcx>(
1940
1940
1941
1941
let discriminant_type_metadata = |discr : Primitive | {
1942
1942
let enumerators_metadata: Vec < _ > = match enum_type. kind ( ) {
1943
- ty:: Adt ( def, _) => iter:: zip ( def. discriminants ( tcx) , & def. variants )
1943
+ ty:: Adt ( def, _) => iter:: zip ( def. discriminants ( tcx) , def. variants ( ) )
1944
1944
. map ( |( ( _, discr) , v) | {
1945
1945
let name = v. name . as_str ( ) ;
1946
1946
let is_unsigned = match discr. ty . kind ( ) {
@@ -2311,7 +2311,7 @@ fn set_members_of_composite_type<'ll, 'tcx>(
2311
2311
fn compute_type_parameters < ' ll , ' tcx > ( cx : & CodegenCx < ' ll , ' tcx > , ty : Ty < ' tcx > ) -> & ' ll DIArray {
2312
2312
if let ty:: Adt ( def, substs) = * ty. kind ( ) {
2313
2313
if substs. types ( ) . next ( ) . is_some ( ) {
2314
- let generics = cx. tcx . generics_of ( def. did ) ;
2314
+ let generics = cx. tcx . generics_of ( def. did ( ) ) ;
2315
2315
let names = get_parameter_names ( cx, generics) ;
2316
2316
let template_params: Vec < _ > = iter:: zip ( substs, names)
2317
2317
. filter_map ( |( kind, name) | {
0 commit comments