Simplify an ObjectData field
This commit is contained in:
@@ -243,12 +243,12 @@ pub fn upcast_choices<'tcx>(
|
||||
/// `object.upcast_trait_ref`) within the vtable for `object`.
|
||||
pub fn get_vtable_index_of_object_method<'tcx, N>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
object: &super::ImplSourceObjectData<'tcx, N>,
|
||||
object: &super::ImplSourceObjectData<N>,
|
||||
method_def_id: DefId,
|
||||
) -> 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_ref.def_id())
|
||||
tcx.own_existential_vtable_entries(object.upcast_trait_def_id)
|
||||
.iter()
|
||||
.copied()
|
||||
.position(|def_id| def_id == method_def_id)
|
||||
|
||||
Reference in New Issue
Block a user