Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 69b57c2

Browse files
committed
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 rust-lang/compiler-team#606
1 parent e88c405 commit 69b57c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/value_and_place.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,8 @@ impl<'tcx> CPlace<'tcx> {
701701
};
702702
}
703703
ty::Adt(adt_def, substs) if layout.ty.is_simd() => {
704-
let f0_ty = adt_def.non_enum_variant().fields[0].ty(fx.tcx, substs);
704+
let f0 = &adt_def.non_enum_variant().fields[FieldIdx::from_u32(0)];
705+
let f0_ty = f0.ty(fx.tcx, substs);
705706

706707
match f0_ty.kind() {
707708
ty::Array(_, _) => {

0 commit comments

Comments
 (0)