diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-06-04 01:44:40 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-06-05 19:15:56 -0700 |
| commit | 8bce2255e826a11d1aa345d1786f85d22c5f921a (patch) | |
| tree | c90edaa44e96973f9ac1bab06c7d770d0be58edf /compiler/rustc_codegen_cranelift/src/vtable.rs | |
| parent | ccf3198de316b488ee17441935182e9d5292b4d3 (diff) | |
| download | rust-8bce2255e826a11d1aa345d1786f85d22c5f921a.tar.gz rust-8bce2255e826a11d1aa345d1786f85d22c5f921a.zip | |
Update `InterpCx::project_field` to take `FieldIdx`
As suggested by Ralf in 142005.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/vtable.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/vtable.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/vtable.rs b/compiler/rustc_codegen_cranelift/src/vtable.rs index 9d9e0462a9b..05a8e3c3342 100644 --- a/compiler/rustc_codegen_cranelift/src/vtable.rs +++ b/compiler/rustc_codegen_cranelift/src/vtable.rs @@ -53,7 +53,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>( .layout() .non_1zst_field(fx) .expect("not exactly one non-1-ZST field in a `DispatchFromDyn` type"); - arg = arg.value_field(fx, FieldIdx::new(idx)); + arg = arg.value_field(fx, idx); } } @@ -62,8 +62,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>( let inner_layout = fx.layout_of(arg.layout().ty.builtin_deref(true).unwrap()); let dyn_star = CPlace::for_ptr(Pointer::new(arg.load_scalar(fx)), inner_layout); let ptr = dyn_star.place_field(fx, FieldIdx::ZERO).to_ptr(); - let vtable = - dyn_star.place_field(fx, FieldIdx::new(1)).to_cvalue(fx).load_scalar(fx); + let vtable = dyn_star.place_field(fx, FieldIdx::ONE).to_cvalue(fx).load_scalar(fx); break 'block (ptr, vtable); } } |
