From df6f7133ee20b545a362f0419807c4beb0ea76ff Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 9 May 2024 16:42:26 +1000 Subject: [PATCH] De-tuple two `vtable_trait_first_method_offset` args. Thus eliminating a `FIXME` comment. --- .../src/traits/select/confirmation.rs | 3 ++- compiler/rustc_trait_selection/src/traits/vtable.rs | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 4fa2455c42de..3d9d12bbd94d 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -693,7 +693,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let vtable_base = vtable_trait_first_method_offset( tcx, - (unnormalized_upcast_trait_ref, ty::Binder::dummy(object_trait_ref)), + unnormalized_upcast_trait_ref, + ty::Binder::dummy(object_trait_ref), ); Ok(ImplSource::Builtin(BuiltinImplSource::Object { vtable_base: vtable_base }, nested)) diff --git a/compiler/rustc_trait_selection/src/traits/vtable.rs b/compiler/rustc_trait_selection/src/traits/vtable.rs index 178f3c63ef73..3f1ba80acd3d 100644 --- a/compiler/rustc_trait_selection/src/traits/vtable.rs +++ b/compiler/rustc_trait_selection/src/traits/vtable.rs @@ -320,16 +320,11 @@ fn vtable_entries<'tcx>( } /// Find slot base for trait methods within vtable entries of another trait -// FIXME(@lcnr): This isn't a query, so why does it take a tuple as its argument. pub(super) fn vtable_trait_first_method_offset<'tcx>( tcx: TyCtxt<'tcx>, - key: ( - ty::PolyTraitRef<'tcx>, // trait_to_be_found - ty::PolyTraitRef<'tcx>, // trait_owning_vtable - ), + trait_to_be_found: ty::PolyTraitRef<'tcx>, + trait_owning_vtable: ty::PolyTraitRef<'tcx>, ) -> usize { - let (trait_to_be_found, trait_owning_vtable) = key; - // #90177 let trait_to_be_found_erased = tcx.erase_regions(trait_to_be_found);