diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-03-13 14:39:10 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-03-13 14:39:10 +0100 |
| commit | 6e42ca187fa8fc70c8cd0571348da4b3d0021513 (patch) | |
| tree | 443b3545c01391544c5488095fc68fd96837e57c | |
| parent | d2026d679e33252cf6e2569ae052b0c54518e24a (diff) | |
| parent | e439761b8fe67f39c1a987fae10433b9a29c045a (diff) | |
| download | rust-6e42ca187fa8fc70c8cd0571348da4b3d0021513.tar.gz rust-6e42ca187fa8fc70c8cd0571348da4b3d0021513.zip | |
Sync from rust 4800c7816ee1937d028407066d229f74b4673c92
| -rw-r--r-- | src/common.rs | 2 | ||||
| -rw-r--r-- | src/unsize.rs | 4 | ||||
| -rw-r--r-- | src/value_and_place.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/common.rs b/src/common.rs index d3e36be3244..89fd0bfa8bb 100644 --- a/src/common.rs +++ b/src/common.rs @@ -67,7 +67,7 @@ fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Typ pointer_ty(tcx) } } - ty::Adt(adt_def, _) if adt_def.repr.simd() => { + ty::Adt(adt_def, _) if adt_def.repr().simd() => { let (element, count) = match &tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap().abi { Abi::Vector { element, count } => (element.clone(), *count), diff --git a/src/unsize.rs b/src/unsize.rs index 8cae506e0cb..fd63c3ecddb 100644 --- a/src/unsize.rs +++ b/src/unsize.rs @@ -127,7 +127,7 @@ pub(crate) fn coerce_unsized_into<'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.value_field(fx, mir::Field::new(i)); let dst_f = dst.place_field(fx, mir::Field::new(i)); @@ -200,7 +200,7 @@ pub(crate) fn size_and_align_of_dst<'tcx>( // Packed types ignore the alignment of their fields. if let ty::Adt(def, _) = layout.ty.kind() { - if def.repr.packed() { + if def.repr().packed() { unsized_align = sized_align; } } diff --git a/src/value_and_place.rs b/src/value_and_place.rs index b016af5174e..afe8797a030 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -24,7 +24,7 @@ fn codegen_field<'tcx>( } match field_layout.ty.kind() { ty::Slice(..) | ty::Str | ty::Foreign(..) => simple(fx), - ty::Adt(def, _) if def.repr.packed() => { + ty::Adt(def, _) if def.repr().packed() => { assert_eq!(layout.align.abi.bytes(), 1); simple(fx) } @@ -816,7 +816,7 @@ pub(crate) fn assert_assignable<'tcx>( // dyn for<'r> Trait<'r> -> dyn Trait<'_> is allowed } (&ty::Adt(adt_def_a, substs_a), &ty::Adt(adt_def_b, substs_b)) - if adt_def_a.did == adt_def_b.did => + if adt_def_a.did() == adt_def_b.did() => { let mut types_a = substs_a.types(); let mut types_b = substs_b.types(); |
