Only compute vtable information during codegen
This commit is contained in:
parent
f8e5660532
commit
3b9adbec32
14 changed files with 141 additions and 195 deletions
|
@ -360,6 +360,14 @@ impl<'tcx> Key for (ty::ParamEnv<'tcx>, ty::TraitRef<'tcx>) {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Key for ty::TraitRef<'tcx> {
|
||||
type Cache<V> = DefaultCache<Self, V>;
|
||||
|
||||
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
|
||||
tcx.def_span(self.def_id)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Key for ty::PolyTraitRef<'tcx> {
|
||||
type Cache<V> = DefaultCache<Self, V>;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ use crate::traits::{
|
|||
};
|
||||
use crate::ty::fast_reject::SimplifiedType;
|
||||
use crate::ty::layout::ValidityRequirement;
|
||||
use crate::ty::print::PrintTraitRefExt;
|
||||
use crate::ty::util::AlwaysRequiresDrop;
|
||||
use crate::ty::TyCtxtFeed;
|
||||
use crate::ty::{
|
||||
|
@ -1271,7 +1272,11 @@ rustc_queries! {
|
|||
desc { |tcx| "finding all vtable entries for trait `{}`", tcx.def_path_str(key.def_id()) }
|
||||
}
|
||||
|
||||
query vtable_trait_upcasting_coercion_new_vptr_slot(key: (Ty<'tcx>, Ty<'tcx>)) -> Option<usize> {
|
||||
query first_method_vtable_slot(key: ty::TraitRef<'tcx>) -> usize {
|
||||
desc { |tcx| "finding the slot within the vtable of `{}` for the implementation of `{}`", key.self_ty(), key.print_only_trait_name() }
|
||||
}
|
||||
|
||||
query supertrait_vtable_slot(key: (Ty<'tcx>, Ty<'tcx>)) -> Option<usize> {
|
||||
desc { |tcx| "finding the slot within vtable for trait object `{}` vtable ptr during trait upcasting coercion from `{}` vtable",
|
||||
key.1, key.0 }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue