diff options
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/glue.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/place.rs | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 11f32d92e44..0b31e4b5582 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -255,7 +255,7 @@ pub fn coerce_unsized_into<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( (&ty::Adt(def_a, _), &ty::Adt(def_b, _)) => { assert_eq!(def_a, def_b); - for i in 0..def_a.variants[VariantIdx::new(0)].fields.len() { + for i in 0..def_a.variant(VariantIdx::new(0)).fields.len() { let src_f = src.project_field(bx, i); let dst_f = dst.project_field(bx, i); diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index 62a297937d4..67df64e9b1b 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -74,7 +74,7 @@ fn push_debuginfo_type_name<'tcx>( if def.is_enum() && cpp_like_debuginfo { msvc_enum_fallback(tcx, t, def, substs, output, visited); } else { - push_item_name(tcx, def.did, qualified, output); + push_item_name(tcx, def.did(), qualified, output); push_generic_params_internal(tcx, substs, output, visited); } } @@ -405,15 +405,15 @@ fn push_debuginfo_type_name<'tcx>( fn msvc_enum_fallback<'tcx>( tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, - def: &AdtDef, + def: AdtDef<'tcx>, substs: SubstsRef<'tcx>, output: &mut String, visited: &mut FxHashSet<Ty<'tcx>>, ) { - let layout = tcx.layout_of(tcx.param_env(def.did).and(ty)).expect("layout error"); + let layout = tcx.layout_of(tcx.param_env(def.did()).and(ty)).expect("layout error"); output.push_str("enum$<"); - push_item_name(tcx, def.did, true, output); + push_item_name(tcx, def.did(), true, output); push_generic_params_internal(tcx, substs, output, visited); if let Variants::Multiple { @@ -435,14 +435,14 @@ fn push_debuginfo_type_name<'tcx>( let max = dataful_discriminant_range.end; let max = tag.value.size(&tcx).truncate(max); - let dataful_variant_name = def.variants[*dataful_variant].name.as_str(); + let dataful_variant_name = def.variant(*dataful_variant).name.as_str(); output.push_str(&format!(", {}, {}, {}", min, max, dataful_variant_name)); } else if let Variants::Single { index: variant_idx } = &layout.variants { // Uninhabited enums can't be constructed and should never need to be visualized so // skip this step for them. - if def.variants.len() != 0 { - let variant = def.variants[*variant_idx].name.as_str(); + if def.variants().len() != 0 { + let variant = def.variant(*variant_idx).name.as_str(); output.push_str(&format!(", {}", variant)); } diff --git a/compiler/rustc_codegen_ssa/src/glue.rs b/compiler/rustc_codegen_ssa/src/glue.rs index 2c4e6bbe9a5..694f5434e9a 100644 --- a/compiler/rustc_codegen_ssa/src/glue.rs +++ b/compiler/rustc_codegen_ssa/src/glue.rs @@ -74,7 +74,7 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( // Packed types ignore the alignment of their fields. if let ty::Adt(def, _) = t.kind() { - if def.repr.packed() { + if def.repr().packed() { unsized_align = sized_align; } } diff --git a/compiler/rustc_codegen_ssa/src/mir/place.rs b/compiler/rustc_codegen_ssa/src/mir/place.rs index 809d6447908..2b8fa3be56d 100644 --- a/compiler/rustc_codegen_ssa/src/mir/place.rs +++ b/compiler/rustc_codegen_ssa/src/mir/place.rs @@ -149,7 +149,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> { _ if !field.is_unsized() => return simple(), ty::Slice(..) | ty::Str | ty::Foreign(..) => return simple(), ty::Adt(def, _) => { - if def.repr.packed() { + if def.repr().packed() { // FIXME(eddyb) generalize the adjustment when we // start supporting packing to larger alignments. assert_eq!(self.layout.align.abi.bytes(), 1); |
