@@ -343,7 +343,7 @@ fn fixed_vec_metadata(
343343
344344 let ( size, align) = cx. size_and_align_of ( array_or_slice_type) ;
345345
346- let upper_bound = match array_or_slice_type. kind ( ) {
346+ let upper_bound = match array_or_slice_type. data ( ) {
347347 ty:: Array ( _, len) => len. eval_usize ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) as c_longlong ,
348348 _ => -1 ,
349349 } ;
@@ -432,7 +432,7 @@ fn subroutine_type_metadata(
432432
433433 let signature_metadata: Vec < _ > = iter:: once (
434434 // return type
435- match signature. output ( ) . kind ( ) {
435+ match signature. output ( ) . data ( ) {
436436 ty:: Tuple ( ref tys) if tys. is_empty ( ) => None ,
437437 _ => Some ( type_metadata ( cx, signature. output ( ) , span) ) ,
438438 } ,
@@ -472,7 +472,7 @@ fn trait_pointer_metadata(
472472 // type is assigned the correct name, size, namespace, and source location.
473473 // However, it does not describe the trait's methods.
474474
475- let containing_scope = match trait_type. kind ( ) {
475+ let containing_scope = match trait_type. data ( ) {
476476 ty:: Dynamic ( ref data, ..) => {
477477 data. principal_def_id ( ) . map ( |did| get_namespace_for_item ( cx, did) )
478478 }
@@ -572,7 +572,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
572572
573573 debug ! ( "type_metadata: {:?}" , t) ;
574574
575- let ptr_metadata = |ty : Ty < ' tcx > | match * ty. kind ( ) {
575+ let ptr_metadata = |ty : Ty < ' tcx > | match * ty. data ( ) {
576576 ty:: Slice ( typ) => Ok ( vec_slice_metadata ( cx, t, typ, unique_type_id, usage_site_span) ) ,
577577 ty:: Str => Ok ( vec_slice_metadata ( cx, t, cx. tcx . types . u8 , unique_type_id, usage_site_span) ) ,
578578 ty:: Dynamic ( ..) => Ok ( MetadataCreationResult :: new (
@@ -592,7 +592,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
592592 }
593593 } ;
594594
595- let MetadataCreationResult { metadata, already_stored_in_typemap } = match * t. kind ( ) {
595+ let MetadataCreationResult { metadata, already_stored_in_typemap } = match * t. data ( ) {
596596 ty:: Never | ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) => {
597597 MetadataCreationResult :: new ( basic_type_metadata ( cx, t) , false )
598598 }
@@ -876,7 +876,7 @@ fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
876876 // .natvis visualizers (and perhaps other existing native debuggers?)
877877 let msvc_like_names = cx. tcx . sess . target . target . options . is_like_msvc ;
878878
879- let ( name, encoding) = match t. kind ( ) {
879+ let ( name, encoding) = match t. data ( ) {
880880 ty:: Never => ( "!" , DW_ATE_unsigned ) ,
881881 ty:: Tuple ( ref elements) if elements. is_empty ( ) => ( "()" , DW_ATE_unsigned ) ,
882882 ty:: Bool => ( "bool" , DW_ATE_boolean ) ,
@@ -904,7 +904,7 @@ fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
904904 return ty_metadata;
905905 }
906906
907- let typedef_name = match t. kind ( ) {
907+ let typedef_name = match t. data ( ) {
908908 ty:: Int ( int_ty) => int_ty. name_str ( ) ,
909909 ty:: Uint ( uint_ty) => uint_ty. name_str ( ) ,
910910 ty:: Float ( float_ty) => float_ty. name_str ( ) ,
@@ -1239,7 +1239,7 @@ fn prepare_struct_metadata(
12391239) -> RecursiveTypeDescription < ' ll , ' tcx > {
12401240 let struct_name = compute_debuginfo_type_name ( cx. tcx , struct_type, false ) ;
12411241
1242- let ( struct_def_id, variant) = match struct_type. kind ( ) {
1242+ let ( struct_def_id, variant) = match struct_type. data ( ) {
12431243 ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
12441244 _ => bug ! ( "prepare_struct_metadata on a non-ADT" ) ,
12451245 } ;
@@ -1373,7 +1373,7 @@ fn prepare_union_metadata(
13731373) -> RecursiveTypeDescription < ' ll , ' tcx > {
13741374 let union_name = compute_debuginfo_type_name ( cx. tcx , union_type, false ) ;
13751375
1376- let ( union_def_id, variant) = match union_type. kind ( ) {
1376+ let ( union_def_id, variant) = match union_type. data ( ) {
13771377 ty:: Adt ( def, _) => ( def. did , def. non_enum_variant ( ) ) ,
13781378 _ => bug ! ( "prepare_union_metadata on a non-ADT" ) ,
13791379 } ;
@@ -1457,14 +1457,14 @@ struct EnumMemberDescriptionFactory<'ll, 'tcx> {
14571457
14581458impl EnumMemberDescriptionFactory < ' ll , ' tcx > {
14591459 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 . data ( ) {
14611461 ty:: Generator ( def_id, ..) => {
14621462 Some ( generator_layout_and_saved_local_names ( cx. tcx , def_id) )
14631463 }
14641464 _ => None ,
14651465 } ;
14661466
1467- let variant_info_for = |index : VariantIdx | match * self . enum_type . kind ( ) {
1467+ let variant_info_for = |index : VariantIdx | match * self . enum_type . data ( ) {
14681468 ty:: Adt ( adt, _) => VariantInfo :: Adt ( & adt. variants [ index] ) ,
14691469 ty:: Generator ( def_id, _, _) => {
14701470 let ( generator_layout, generator_saved_local_names) =
@@ -1486,14 +1486,14 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
14861486 } else {
14871487 type_metadata ( cx, self . enum_type , self . span )
14881488 } ;
1489- let flags = match self . enum_type . kind ( ) {
1489+ let flags = match self . enum_type . data ( ) {
14901490 ty:: Generator ( ..) => DIFlags :: FlagArtificial ,
14911491 _ => DIFlags :: FlagZero ,
14921492 } ;
14931493
14941494 match self . layout . variants {
14951495 Variants :: Single { index } => {
1496- if let ty:: Adt ( adt, _) = self . enum_type . kind ( ) {
1496+ if let ty:: Adt ( adt, _) = self . enum_type . data ( ) {
14971497 if adt. variants . is_empty ( ) {
14981498 return vec ! [ ] ;
14991499 }
@@ -1941,7 +1941,7 @@ fn prepare_enum_metadata(
19411941 let tcx = cx. tcx ;
19421942 let enum_name = compute_debuginfo_type_name ( tcx, enum_type, false ) ;
19431943 // FIXME(tmandry): This doesn't seem to have any effect.
1944- let enum_flags = match enum_type. kind ( ) {
1944+ let enum_flags = match enum_type. data ( ) {
19451945 ty:: Generator ( ..) => DIFlags :: FlagArtificial ,
19461946 _ => DIFlags :: FlagZero ,
19471947 } ;
@@ -1956,13 +1956,13 @@ fn prepare_enum_metadata(
19561956 let file_metadata = unknown_file_metadata ( cx) ;
19571957
19581958 let discriminant_type_metadata = |discr : Primitive | {
1959- let enumerators_metadata: Vec < _ > = match enum_type. kind ( ) {
1959+ let enumerators_metadata: Vec < _ > = match enum_type. data ( ) {
19601960 ty:: Adt ( def, _) => def
19611961 . discriminants ( tcx)
19621962 . zip ( & def. variants )
19631963 . map ( |( ( _, discr) , v) | {
19641964 let name = v. ident . as_str ( ) ;
1965- let is_unsigned = match discr. ty . kind ( ) {
1965+ let is_unsigned = match discr. ty . data ( ) {
19661966 ty:: Int ( _) => false ,
19671967 ty:: Uint ( _) => true ,
19681968 _ => bug ! ( "non integer discriminant" ) ,
@@ -2011,7 +2011,7 @@ fn prepare_enum_metadata(
20112011 type_metadata ( cx, discr. to_ty ( tcx) , rustc_span:: DUMMY_SP ) ;
20122012
20132013 let item_name;
2014- let discriminant_name = match enum_type. kind ( ) {
2014+ let discriminant_name = match enum_type. data ( ) {
20152015 ty:: Adt ( ..) => {
20162016 item_name = tcx. item_name ( enum_def_id) . as_str ( ) ;
20172017 & * item_name
@@ -2104,7 +2104,7 @@ fn prepare_enum_metadata(
21042104 ) ;
21052105 }
21062106
2107- let discriminator_name = match enum_type. kind ( ) {
2107+ let discriminator_name = match enum_type. data ( ) {
21082108 ty:: Generator ( ..) => "__state" ,
21092109 _ => "" ,
21102110 } ;
@@ -2327,7 +2327,7 @@ fn set_members_of_composite_type(
23272327
23282328/// Computes the type parameters for a type, if any, for the given metadata.
23292329fn compute_type_parameters ( cx : & CodegenCx < ' ll , ' tcx > , ty : Ty < ' tcx > ) -> Option < & ' ll DIArray > {
2330- if let ty:: Adt ( def, substs) = * ty. kind ( ) {
2330+ if let ty:: Adt ( def, substs) = * ty. data ( ) {
23312331 if substs. types ( ) . next ( ) . is_some ( ) {
23322332 let generics = cx. tcx . generics_of ( def. did ) ;
23332333 let names = get_parameter_names ( cx, generics) ;
0 commit comments