1
Fork 0

yeet upcast_trait_def_id from ImplSourceObjectData

This commit is contained in:
Michael Goulet 2023-06-20 21:48:05 +00:00
parent 42571c4847
commit 7d0a5c31f5
4 changed files with 4 additions and 12 deletions

View file

@ -651,11 +651,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
(unnormalized_upcast_trait_ref, ty::Binder::dummy(object_trait_ref)),
);
Ok(ImplSourceObjectData {
upcast_trait_def_id: upcast_trait_ref.def_id(),
vtable_base,
nested,
})
Ok(ImplSourceObjectData { vtable_base, nested })
}
fn confirm_fn_pointer_candidate(

View file

@ -248,7 +248,7 @@ pub fn get_vtable_index_of_object_method<'tcx, N>(
) -> Option<usize> {
// Count number of methods preceding the one we are selecting and
// add them to the total offset.
tcx.own_existential_vtable_entries(object.upcast_trait_def_id)
tcx.own_existential_vtable_entries(tcx.parent(method_def_id))
.iter()
.copied()
.position(|def_id| def_id == method_def_id)