mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
yeet upcast_trait_def_id from ImplSourceObjectData
This commit is contained in:
parent
42571c4847
commit
7d0a5c31f5
@ -703,7 +703,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
|
||||
ImplSource::Param(n, ct) => ImplSource::Param(n.into_iter().map(f).collect(), ct),
|
||||
ImplSource::Builtin(n) => ImplSource::Builtin(n.into_iter().map(f).collect()),
|
||||
ImplSource::Object(o) => ImplSource::Object(ImplSourceObjectData {
|
||||
upcast_trait_def_id: o.upcast_trait_def_id,
|
||||
vtable_base: o.vtable_base,
|
||||
nested: o.nested.into_iter().map(f).collect(),
|
||||
}),
|
||||
@ -750,9 +749,6 @@ pub struct ImplSourceTraitUpcastingData<N> {
|
||||
#[derive(PartialEq, Eq, Clone, TyEncodable, TyDecodable, HashStable, Lift)]
|
||||
#[derive(TypeFoldable, TypeVisitable)]
|
||||
pub struct ImplSourceObjectData<N> {
|
||||
/// `Foo` upcast to the obligation trait. This will be some supertrait of `Foo`.
|
||||
pub upcast_trait_def_id: DefId,
|
||||
|
||||
/// The vtable is formed by concatenating together the method lists of
|
||||
/// the base object trait and all supertraits, pointers to supertrait vtable will
|
||||
/// be provided when necessary; this is the start of `upcast_trait_ref`'s methods
|
||||
|
@ -46,8 +46,8 @@ impl<N: fmt::Debug> fmt::Debug for traits::ImplSourceObjectData<N> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"ImplSourceObjectData(upcast={:?}, vtable_base={}, nested={:?})",
|
||||
self.upcast_trait_def_id, self.vtable_base, self.nested
|
||||
"ImplSourceObjectData(vtable_base={}, nested={:?})",
|
||||
self.vtable_base, self.nested
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user