Update ty::VariantDef
to use IndexVec<FieldIdx, FieldDef>
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
This commit is contained in:
parent
e88c4052c3
commit
69b57c2db5
@ -701,7 +701,8 @@ pub(crate) fn place_field(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
ty::Adt(adt_def, substs) if layout.ty.is_simd() => {
|
ty::Adt(adt_def, substs) if layout.ty.is_simd() => {
|
||||||
let f0_ty = adt_def.non_enum_variant().fields[0].ty(fx.tcx, substs);
|
let f0 = &adt_def.non_enum_variant().fields[FieldIdx::from_u32(0)];
|
||||||
|
let f0_ty = f0.ty(fx.tcx, substs);
|
||||||
|
|
||||||
match f0_ty.kind() {
|
match f0_ty.kind() {
|
||||||
ty::Array(_, _) => {
|
ty::Array(_, _) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user