about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-26 04:29:18 +0000
committerbors <bors@rust-lang.org>2019-09-26 04:29:18 +0000
commitdc45735f29788924b9fc351d100e5bf3ebdca162 (patch)
tree8f2ac002f1aa9d021189c20afb62780efcfbeb08 /src/librustc_codegen_llvm/debuginfo
parenta5bc0f0e3f0c58518c0537d82dee0fcfeb57115c (diff)
parentbc2a373af216aa40032cf51fb435b21f416f0b26 (diff)
downloadrust-dc45735f29788924b9fc351d100e5bf3ebdca162.tar.gz
rust-dc45735f29788924b9fc351d100e5bf3ebdca162.zip
Auto merge of #64513 - varkor:sty-begone, r=eddyb
Rename `TyS.sty` to `TyS.kind`

Fixes https://github.com/rust-lang/rust/issues/64353.

r? @eddyb
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/metadata.rs28
-rw-r--r--src/librustc_codegen_llvm/debuginfo/mod.rs8
2 files changed, 18 insertions, 18 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index d0b607bd88e..02d68f47c7e 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -340,7 +340,7 @@ fn fixed_vec_metadata(
 
     let (size, align) = cx.size_and_align_of(array_or_slice_type);
 
-    let upper_bound = match array_or_slice_type.sty {
+    let upper_bound = match array_or_slice_type.kind {
         ty::Array(_, len) => len.eval_usize(cx.tcx, ty::ParamEnv::reveal_all()) as c_longlong,
         _ => -1
     };
@@ -427,7 +427,7 @@ fn subroutine_type_metadata(
 
     let signature_metadata: Vec<_> = iter::once(
         // return type
-        match signature.output().sty {
+        match signature.output().kind {
             ty::Tuple(ref tys) if tys.is_empty() => None,
             _ => Some(type_metadata(cx, signature.output(), span))
         }
@@ -466,7 +466,7 @@ fn trait_pointer_metadata(
     // type is assigned the correct name, size, namespace, and source location.
     // However, it does not describe the trait's methods.
 
-    let containing_scope = match trait_type.sty {
+    let containing_scope = match trait_type.kind {
         ty::Dynamic(ref data, ..) =>
             data.principal_def_id().map(|did| get_namespace_for_item(cx, did)),
         _ => {
@@ -563,7 +563,7 @@ pub fn type_metadata(
     debug!("type_metadata: {:?}", t);
 
     let ptr_metadata = |ty: Ty<'tcx>| {
-        match ty.sty {
+        match ty.kind {
             ty::Slice(typ) => {
                 Ok(vec_slice_metadata(cx, t, typ, unique_type_id, usage_site_span))
             }
@@ -591,7 +591,7 @@ pub fn type_metadata(
         }
     };
 
-    let MetadataCreationResult { metadata, already_stored_in_typemap } = match t.sty {
+    let MetadataCreationResult { metadata, already_stored_in_typemap } = match t.kind {
         ty::Never    |
         ty::Bool     |
         ty::Char     |
@@ -835,7 +835,7 @@ fn file_metadata_raw(cx: &CodegenCx<'ll, '_>,
 fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
     debug!("basic_type_metadata: {:?}", t);
 
-    let (name, encoding) = match t.sty {
+    let (name, encoding) = match t.kind {
         ty::Never => ("!", DW_ATE_unsigned),
         ty::Tuple(ref elements) if elements.is_empty() =>
             ("()", DW_ATE_unsigned),
@@ -1145,7 +1145,7 @@ fn prepare_struct_metadata(
 ) -> RecursiveTypeDescription<'ll, 'tcx> {
     let struct_name = compute_debuginfo_type_name(cx.tcx, struct_type, false);
 
-    let (struct_def_id, variant) = match struct_type.sty {
+    let (struct_def_id, variant) = match struct_type.kind {
         ty::Adt(def, _) => (def.did, def.non_enum_variant()),
         _ => bug!("prepare_struct_metadata on a non-ADT")
     };
@@ -1268,7 +1268,7 @@ fn prepare_union_metadata(
 ) -> RecursiveTypeDescription<'ll, 'tcx> {
     let union_name = compute_debuginfo_type_name(cx.tcx, union_type, false);
 
-    let (union_def_id, variant) = match union_type.sty {
+    let (union_def_id, variant) = match union_type.kind {
         ty::Adt(def, _) => (def.did, def.non_enum_variant()),
         _ => bug!("prepare_union_metadata on a non-ADT")
     };
@@ -1334,7 +1334,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
     fn create_member_descriptions(&self, cx: &CodegenCx<'ll, 'tcx>)
                                   -> Vec<MemberDescription<'ll>> {
         let variant_info_for = |index: VariantIdx| {
-            match &self.enum_type.sty {
+            match &self.enum_type.kind {
                 ty::Adt(adt, _) => VariantInfo::Adt(&adt.variants[index]),
                 ty::Generator(def_id, substs, _) => {
                     let generator_layout = cx.tcx.generator_layout(*def_id);
@@ -1354,7 +1354,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
 
         match self.layout.variants {
             layout::Variants::Single { index } => {
-                if let ty::Adt(adt, _) = &self.enum_type.sty {
+                if let ty::Adt(adt, _) = &self.enum_type.kind {
                     if adt.variants.is_empty() {
                         return vec![];
                     }
@@ -1747,7 +1747,7 @@ fn prepare_enum_metadata(
     let file_metadata = unknown_file_metadata(cx);
 
     let discriminant_type_metadata = |discr: layout::Primitive| {
-        let enumerators_metadata: Vec<_> = match enum_type.sty {
+        let enumerators_metadata: Vec<_> = match enum_type.kind {
             ty::Adt(def, _) => def
                 .discriminants(cx.tcx)
                 .zip(&def.variants)
@@ -1790,7 +1790,7 @@ fn prepare_enum_metadata(
                 let discriminant_base_type_metadata =
                     type_metadata(cx, discr.to_ty(cx.tcx), syntax_pos::DUMMY_SP);
 
-                let discriminant_name = match enum_type.sty {
+                let discriminant_name = match enum_type.kind {
                     ty::Adt(..) => SmallCStr::new(&cx.tcx.item_name(enum_def_id).as_str()),
                     ty::Generator(..) => SmallCStr::new(&enum_name),
                     _ => bug!(),
@@ -1881,7 +1881,7 @@ fn prepare_enum_metadata(
         );
     }
 
-    let discriminator_name = match &enum_type.sty {
+    let discriminator_name = match &enum_type.kind {
         ty::Generator(..) => Some(SmallCStr::new(&"__state")),
         _ => None,
     };
@@ -2091,7 +2091,7 @@ fn set_members_of_composite_type(cx: &CodegenCx<'ll, 'tcx>,
 // Compute the type parameters for a type, if any, for the given
 // metadata.
 fn compute_type_parameters(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>) -> Option<&'ll DIArray> {
-    if let ty::Adt(def, substs) = ty.sty {
+    if let ty::Adt(def, substs) = ty.kind {
         if !substs.types().next().is_none() {
             let generics = cx.tcx.generics_of(def.did);
             let names = get_parameter_names(cx, generics);
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs
index 6dedf10f0ab..08a37ce9bbf 100644
--- a/src/librustc_codegen_llvm/debuginfo/mod.rs
+++ b/src/librustc_codegen_llvm/debuginfo/mod.rs
@@ -377,7 +377,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
             let mut signature = Vec::with_capacity(sig.inputs().len() + 1);
 
             // Return type -- llvm::DIBuilder wants this at index 0
-            signature.push(match sig.output().sty {
+            signature.push(match sig.output().kind {
                 ty::Tuple(ref tys) if tys.is_empty() => None,
                 _ => Some(type_metadata(cx, sig.output(), syntax_pos::DUMMY_SP))
             });
@@ -401,7 +401,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
                 // This transformed type is wrong, but these function types are
                 // already inaccurate due to ABI adjustments (see #42800).
                 signature.extend(inputs.iter().map(|&t| {
-                    let t = match t.sty {
+                    let t = match t.kind {
                         ty::Array(ct, _)
                             if (ct == cx.tcx.types.u8) || cx.layout_of(ct).is_zst() => {
                             cx.tcx.mk_imm_ptr(ct)
@@ -417,7 +417,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
             }
 
             if sig.abi == Abi::RustCall && !sig.inputs().is_empty() {
-                if let ty::Tuple(args) = sig.inputs()[sig.inputs().len() - 1].sty {
+                if let ty::Tuple(args) = sig.inputs()[sig.inputs().len() - 1].kind {
                     signature.extend(
                         args.iter().map(|argument_type| {
                             Some(type_metadata(cx, argument_type.expect_ty(), syntax_pos::DUMMY_SP))
@@ -516,7 +516,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
 
                     // Only "class" methods are generally understood by LLVM,
                     // so avoid methods on other types (e.g., `<*mut T>::null`).
-                    match impl_self_ty.sty {
+                    match impl_self_ty.kind {
                         ty::Adt(def, ..) if !def.is_box() => {
                             Some(type_metadata(cx, impl_self_ty, syntax_pos::DUMMY_SP))
                         }