Update InterpCx::project_field to take FieldIdx

As suggested by Ralf in 142005.
This commit is contained in:
Scott McMurray
2025-06-04 01:44:40 -07:00
parent ccf3198de3
commit 8bce2255e8
26 changed files with 102 additions and 80 deletions

View File

@@ -1077,7 +1077,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let (idx, _) = op.layout.non_1zst_field(bx).expect(
"not exactly one non-1-ZST field in a `DispatchFromDyn` type",
);
op = op.extract_field(self, bx, idx);
op = op.extract_field(self, bx, idx.as_usize());
}
// Now that we have `*dyn Trait` or `&dyn Trait`, split it up into its
@@ -1109,7 +1109,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let (idx, _) = op.layout.non_1zst_field(bx).expect(
"not exactly one non-1-ZST field in a `DispatchFromDyn` type",
);
op = op.extract_field(self, bx, idx);
op = op.extract_field(self, bx, idx.as_usize());
}
// Make sure that we've actually unwrapped the rcvr down