1
Fork 0

Initial fixes on top of type interner commit

This commit is contained in:
Michael Goulet 2022-05-22 12:57:46 -07:00
parent a7015fe816
commit a056a953f0
28 changed files with 171 additions and 134 deletions

View file

@ -33,7 +33,7 @@ use rustc_hir::lang_items::LangItem;
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::subst::{InternalSubsts, SubstsRef};
use rustc_middle::ty::{
self, GenericParamDefKind, ToPredicate, Ty, TyCtxt, VtblEntry, COMMON_VTABLE_ENTRIES,
self, common_vtable_entries, GenericParamDefKind, ToPredicate, Ty, TyCtxt, VtblEntry,
};
use rustc_span::{sym, Span};
use smallvec::SmallVec;
@ -695,7 +695,7 @@ fn vtable_entries<'tcx>(
let vtable_segment_callback = |segment| -> ControlFlow<()> {
match segment {
VtblSegment::MetadataDSA => {
entries.extend(COMMON_VTABLE_ENTRIES);
entries.extend(common_vtable_entries());
}
VtblSegment::TraitOwnEntries { trait_ref, emit_vptr } => {
let existential_trait_ref = trait_ref
@ -785,7 +785,7 @@ fn vtable_trait_first_method_offset<'tcx>(
move |segment| {
match segment {
VtblSegment::MetadataDSA => {
vtable_base += COMMON_VTABLE_ENTRIES.len();
vtable_base += common_vtable_entries().len();
}
VtblSegment::TraitOwnEntries { trait_ref, emit_vptr } => {
if tcx.erase_regions(trait_ref) == trait_to_be_found_erased {