@@ -343,7 +343,7 @@ fn fixed_vec_metadata(
343
343
344
344
let ( size, align) = cx. size_and_align_of ( array_or_slice_type) ;
345
345
346
- let upper_bound = match array_or_slice_type. kind {
346
+ let upper_bound = match array_or_slice_type. kind ( ) {
347
347
ty:: Array ( _, len) => len. eval_usize ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) as c_longlong ,
348
348
_ => -1 ,
349
349
} ;
@@ -432,7 +432,7 @@ fn subroutine_type_metadata(
432
432
433
433
let signature_metadata: Vec < _ > = iter:: once (
434
434
// return type
435
- match signature. output ( ) . kind {
435
+ match signature. output ( ) . kind ( ) {
436
436
ty:: Tuple ( ref tys) if tys. is_empty ( ) => None ,
437
437
_ => Some ( type_metadata ( cx, signature. output ( ) , span) ) ,
438
438
} ,
@@ -472,7 +472,7 @@ fn trait_pointer_metadata(
472
472
// type is assigned the correct name, size, namespace, and source location.
473
473
// However, it does not describe the trait's methods.
474
474
475
- let containing_scope = match trait_type. kind {
475
+ let containing_scope = match trait_type. kind ( ) {
476
476
ty:: Dynamic ( ref data, ..) => {
477
477
data. principal_def_id ( ) . map ( |did| get_namespace_for_item ( cx, did) )
478
478
}
@@ -572,7 +572,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
572
572
573
573
debug ! ( "type_metadata: {:?}" , t) ;
574
574
575
- let ptr_metadata = |ty : Ty < ' tcx > | match ty. kind {
575
+ let ptr_metadata = |ty : Ty < ' tcx > | match * ty. kind ( ) {
576
576
ty:: Slice ( typ) => Ok ( vec_slice_metadata ( cx, t, typ, unique_type_id, usage_site_span) ) ,
577
577
ty:: Str => Ok ( vec_slice_metadata ( cx, t, cx. tcx . types . u8 , unique_type_id, usage_site_span) ) ,
578
578
ty:: Dynamic ( ..) => Ok ( MetadataCreationResult :: new (
@@ -592,7 +592,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
592
592
}
593
593
} ;
594
594
595
- let MetadataCreationResult { metadata, already_stored_in_typemap } = match t. kind {
595
+ let MetadataCreationResult { metadata, already_stored_in_typemap } = match * t. kind ( ) {
596
596
ty:: Never | ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) => {
597
597
MetadataCreationResult :: new ( basic_type_metadata ( cx, t) , false )
598
598
}
@@ -876,7 +876,7 @@ fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
876
876
// .natvis visualizers (and perhaps other existing native debuggers?)
877
877
let msvc_like_names = cx. tcx . sess . target . target . options . is_like_msvc ;
878
878
879
- let ( name, encoding) = match t. kind {
879
+ let ( name, encoding) = match t. kind ( ) {
880
880
ty:: Never => ( "!" , DW_ATE_unsigned ) ,
881
881
ty:: Tuple ( ref elements) if elements. is_empty ( ) => ( "()" , DW_ATE_unsigned ) ,
882
882
ty:: Bool => ( "bool" , DW_ATE_boolean ) ,
@@ -904,7 +904,7 @@ fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
904
904
return ty_metadata;
905
905
}
906
906
907
- let typedef_name = match t. kind {
907
+ let typedef_name = match t. kind ( ) {
908
908
ty:: Int ( int_ty) => int_ty. name_str ( ) ,
909
909
ty:: Uint ( uint_ty) => uint_ty. name_str ( ) ,
910
910
ty:: Float ( float_ty) => float_ty. name_str ( ) ,
@@ -1239,7 +1239,7 @@ fn prepare_struct_metadata(
1239
1239
) -> RecursiveTypeDescription < ' ll , ' tcx > {
1240
1240
let struct_name = compute_debuginfo_type_name ( cx. tcx , struct_type, false ) ;
1241
1241
1242
- let ( struct_def_id, variant) = match struct_type. kind {
1242
+ let ( struct_def_id, variant) = match struct_type. kind ( ) {
1243
1243
ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
1244
1244
_ => bug ! ( "prepare_struct_metadata on a non-ADT" ) ,
1245
1245
} ;
@@ -1373,7 +1373,7 @@ fn prepare_union_metadata(
1373
1373
) -> RecursiveTypeDescription < ' ll , ' tcx > {
1374
1374
let union_name = compute_debuginfo_type_name ( cx. tcx , union_type, false ) ;
1375
1375
1376
- let ( union_def_id, variant) = match union_type. kind {
1376
+ let ( union_def_id, variant) = match union_type. kind ( ) {
1377
1377
ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
1378
1378
_ => bug ! ( "prepare_union_metadata on a non-ADT" ) ,
1379
1379
} ;
@@ -1457,14 +1457,14 @@ struct EnumMemberDescriptionFactory<'ll, 'tcx> {
1457
1457
1458
1458
impl EnumMemberDescriptionFactory < ' ll , ' tcx > {
1459
1459
fn create_member_descriptions ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> Vec < MemberDescription < ' ll > > {
1460
- let generator_variant_info_data = match self . enum_type . kind {
1460
+ let generator_variant_info_data = match * self . enum_type . kind ( ) {
1461
1461
ty:: Generator ( def_id, ..) => {
1462
1462
Some ( generator_layout_and_saved_local_names ( cx. tcx , def_id) )
1463
1463
}
1464
1464
_ => None ,
1465
1465
} ;
1466
1466
1467
- let variant_info_for = |index : VariantIdx | match self . enum_type . kind {
1467
+ let variant_info_for = |index : VariantIdx | match * self . enum_type . kind ( ) {
1468
1468
ty:: Adt ( adt, _) => VariantInfo :: Adt ( & adt. variants [ index] ) ,
1469
1469
ty:: Generator ( def_id, _, _) => {
1470
1470
let ( generator_layout, generator_saved_local_names) =
@@ -1486,14 +1486,14 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1486
1486
} else {
1487
1487
type_metadata ( cx, self . enum_type , self . span )
1488
1488
} ;
1489
- let flags = match self . enum_type . kind {
1489
+ let flags = match self . enum_type . kind ( ) {
1490
1490
ty:: Generator ( ..) => DIFlags :: FlagArtificial ,
1491
1491
_ => DIFlags :: FlagZero ,
1492
1492
} ;
1493
1493
1494
1494
match self . layout . variants {
1495
1495
Variants :: Single { index } => {
1496
- if let ty:: Adt ( adt, _) = & self . enum_type . kind {
1496
+ if let ty:: Adt ( adt, _) = self . enum_type . kind ( ) {
1497
1497
if adt. variants . is_empty ( ) {
1498
1498
return vec ! [ ] ;
1499
1499
}
@@ -1942,7 +1942,7 @@ fn prepare_enum_metadata(
1942
1942
let tcx = cx. tcx ;
1943
1943
let enum_name = compute_debuginfo_type_name ( tcx, enum_type, false ) ;
1944
1944
// FIXME(tmandry): This doesn't seem to have any effect.
1945
- let enum_flags = match enum_type. kind {
1945
+ let enum_flags = match enum_type. kind ( ) {
1946
1946
ty:: Generator ( ..) => DIFlags :: FlagArtificial ,
1947
1947
_ => DIFlags :: FlagZero ,
1948
1948
} ;
@@ -1957,13 +1957,13 @@ fn prepare_enum_metadata(
1957
1957
let file_metadata = unknown_file_metadata ( cx) ;
1958
1958
1959
1959
let discriminant_type_metadata = |discr : Primitive | {
1960
- let enumerators_metadata: Vec < _ > = match enum_type. kind {
1960
+ let enumerators_metadata: Vec < _ > = match enum_type. kind ( ) {
1961
1961
ty:: Adt ( def, _) => def
1962
1962
. discriminants ( tcx)
1963
1963
. zip ( & def. variants )
1964
1964
. map ( |( ( _, discr) , v) | {
1965
1965
let name = v. ident . as_str ( ) ;
1966
- let is_unsigned = match discr. ty . kind {
1966
+ let is_unsigned = match discr. ty . kind ( ) {
1967
1967
ty:: Int ( _) => false ,
1968
1968
ty:: Uint ( _) => true ,
1969
1969
_ => bug ! ( "non integer discriminant" ) ,
@@ -2012,7 +2012,7 @@ fn prepare_enum_metadata(
2012
2012
type_metadata ( cx, discr. to_ty ( tcx) , rustc_span:: DUMMY_SP ) ;
2013
2013
2014
2014
let item_name;
2015
- let discriminant_name = match enum_type. kind {
2015
+ let discriminant_name = match enum_type. kind ( ) {
2016
2016
ty:: Adt ( ..) => {
2017
2017
item_name = tcx. item_name ( enum_def_id) . as_str ( ) ;
2018
2018
& * item_name
@@ -2105,7 +2105,7 @@ fn prepare_enum_metadata(
2105
2105
) ;
2106
2106
}
2107
2107
2108
- let discriminator_name = match & enum_type. kind {
2108
+ let discriminator_name = match enum_type. kind ( ) {
2109
2109
ty:: Generator ( ..) => "__state" ,
2110
2110
_ => "" ,
2111
2111
} ;
@@ -2328,7 +2328,7 @@ fn set_members_of_composite_type(
2328
2328
2329
2329
/// Computes the type parameters for a type, if any, for the given metadata.
2330
2330
fn compute_type_parameters ( cx : & CodegenCx < ' ll , ' tcx > , ty : Ty < ' tcx > ) -> Option < & ' ll DIArray > {
2331
- if let ty:: Adt ( def, substs) = ty. kind {
2331
+ if let ty:: Adt ( def, substs) = * ty. kind ( ) {
2332
2332
if substs. types ( ) . next ( ) . is_some ( ) {
2333
2333
let generics = cx. tcx . generics_of ( def. did ) ;
2334
2334
let names = get_parameter_names ( cx, generics) ;
0 commit comments