about summary refs log tree commit diff
path: root/src/vtable.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-03-28 12:32:57 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-03-28 22:22:37 -0700
commit406eb96437d9a75d17c0aa3dcc3cec7c0c8eb69d (patch)
tree17e442efaaf245e9c887ecad8545246f615c4ed4 /src/vtable.rs
parent37ab4bd419ab7e87a6e6f592f9da62f35c4b9f98 (diff)
Move `mir::Field` → `abi::FieldIdx`
The first PR for https://github.com/rust-lang/compiler-team/issues/606

This is just the move-and-rename, because it's plenty big-and-bitrotty already.  Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
Diffstat (limited to 'src/vtable.rs')
-rw-r--r--src/vtable.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vtable.rs b/src/vtable.rs
index 94806e0d798..b309695c190 100644
--- a/src/vtable.rs
+++ b/src/vtable.rs
@@ -50,7 +50,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
         if let Abi::Scalar(_) = arg.layout().abi {
             'descend_newtypes: while !arg.layout().ty.is_unsafe_ptr() && !arg.layout().ty.is_ref() {
                 for i in 0..arg.layout().fields.count() {
-                    let field = arg.value_field(fx, mir::Field::new(i));
+                    let field = arg.value_field(fx, FieldIdx::new(i));
                     if !field.layout().is_zst() {
                         // we found the one non-zero-sized field that is allowed
                         // now find *its* non-zero-sized field, or stop if it's a
@@ -68,9 +68,9 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
             if ty.is_dyn_star() {
                 let inner_layout = fx.layout_of(arg.layout().ty.builtin_deref(true).unwrap().ty);
                 let dyn_star = CPlace::for_ptr(Pointer::new(arg.load_scalar(fx)), inner_layout);
-                let ptr = dyn_star.place_field(fx, mir::Field::new(0)).to_ptr();
+                let ptr = dyn_star.place_field(fx, FieldIdx::new(0)).to_ptr();
                 let vtable =
-                    dyn_star.place_field(fx, mir::Field::new(1)).to_cvalue(fx).load_scalar(fx);
+                    dyn_star.place_field(fx, FieldIdx::new(1)).to_cvalue(fx).load_scalar(fx);
                 break 'block (ptr, vtable);
             }
         }