Skip to content

Commit 4d97376

Browse files
committed
Rename ty::TyKind to ty::TyData, Ty::kind to Ty::data
1 parent c38f001 commit 4d97376

File tree

266 files changed

+1340
-1340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+1340
-1340
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
307307
use rustc_ast::UintTy::*;
308308
use rustc_middle::ty::{Int, Uint};
309309

310-
let new_kind = match ty.kind() {
310+
let new_kind = match ty.data() {
311311
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.ptr_width)),
312312
Uint(t @ Usize) => Uint(t.normalize(self.tcx.sess.target.ptr_width)),
313313
t @ (Uint(_) | Int(_)) => t.clone(),

compiler/rustc_codegen_llvm/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn check_and_apply_linkage(
121121
// extern "C" fn() from being non-null, so we can't just declare a
122122
// static and call it a day. Some linkages (like weak) will make it such
123123
// that the static actually has a null value.
124-
let llty2 = if let ty::RawPtr(ref mt) = ty.kind() {
124+
let llty2 = if let ty::RawPtr(ref mt) = ty.data() {
125125
cx.layout_of(mt.ty).llvm_type(cx)
126126
} else {
127127
cx.sess().span_fatal(

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

14581458
impl 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.
23292329
fn 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);

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
361361
// already inaccurate due to ABI adjustments (see #42800).
362362
signature.extend(fn_abi.args.iter().map(|arg| {
363363
let t = arg.layout.ty;
364-
let t = match t.kind() {
364+
let t = match t.data() {
365365
ty::Array(ct, _)
366366
if (*ct == cx.tcx.types.u8) || cx.layout_of(ct).is_zst() =>
367367
{
@@ -467,7 +467,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
467467

468468
// Only "class" methods are generally understood by LLVM,
469469
// so avoid methods on other types (e.g., `<*mut T>::null`).
470-
match impl_self_ty.kind() {
470+
match impl_self_ty.data() {
471471
ty::Adt(def, ..) if !def.is_box() => {
472472
// Again, only create type information if full debuginfo is enabled
473473
if cx.sess().opts.debuginfo == DebugInfo::Full

0 commit comments

Comments
 (0)