Skip to content

Commit df6f713

Browse files
committed
De-tuple two vtable_trait_first_method_offset args.
Thus eliminating a `FIXME` comment.
1 parent 24445d3 commit df6f713

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
693693

694694
let vtable_base = vtable_trait_first_method_offset(
695695
tcx,
696-
(unnormalized_upcast_trait_ref, ty::Binder::dummy(object_trait_ref)),
696+
unnormalized_upcast_trait_ref,
697+
ty::Binder::dummy(object_trait_ref),
697698
);
698699

699700
Ok(ImplSource::Builtin(BuiltinImplSource::Object { vtable_base: vtable_base }, nested))

compiler/rustc_trait_selection/src/traits/vtable.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,11 @@ fn vtable_entries<'tcx>(
320320
}
321321

322322
/// Find slot base for trait methods within vtable entries of another trait
323-
// FIXME(@lcnr): This isn't a query, so why does it take a tuple as its argument.
324323
pub(super) fn vtable_trait_first_method_offset<'tcx>(
325324
tcx: TyCtxt<'tcx>,
326-
key: (
327-
ty::PolyTraitRef<'tcx>, // trait_to_be_found
328-
ty::PolyTraitRef<'tcx>, // trait_owning_vtable
329-
),
325+
trait_to_be_found: ty::PolyTraitRef<'tcx>,
326+
trait_owning_vtable: ty::PolyTraitRef<'tcx>,
330327
) -> usize {
331-
let (trait_to_be_found, trait_owning_vtable) = key;
332-
333328
// #90177
334329
let trait_to_be_found_erased = tcx.erase_regions(trait_to_be_found);
335330

0 commit comments

Comments
 (0)