impl_parent
This commit is contained in:
parent
aa5a532046
commit
03fe10d91d
@ -156,6 +156,7 @@ pub enum DepNode<D: Clone + Debug> {
|
||||
Deprecation(D),
|
||||
ItemBodyNestedBodies(D),
|
||||
ConstIsRvaluePromotableToStatic(D),
|
||||
ImplParent(D),
|
||||
TraitOfItem(D),
|
||||
IsMirAvailable(D),
|
||||
ItemAttrs(D),
|
||||
@ -272,6 +273,7 @@ impl<D: Clone + Debug> DepNode<D> {
|
||||
Deprecation(ref d) => op(d).map(Deprecation),
|
||||
ItemAttrs(ref d) => op(d).map(ItemAttrs),
|
||||
FnArgNames(ref d) => op(d).map(FnArgNames),
|
||||
ImplParent(ref d) => op(d).map(ImplParent),
|
||||
TraitOfItem(ref d) => op(d).map(TraitOfItem),
|
||||
ItemBodyNestedBodies(ref d) => op(d).map(ItemBodyNestedBodies),
|
||||
ConstIsRvaluePromotableToStatic(ref d) => op(d).map(ConstIsRvaluePromotableToStatic),
|
||||
|
@ -188,7 +188,6 @@ pub trait CrateStore {
|
||||
|
||||
// impl info
|
||||
fn impl_defaultness(&self, def: DefId) -> hir::Defaultness;
|
||||
fn impl_parent(&self, impl_def_id: DefId) -> Option<DefId>;
|
||||
|
||||
// trait/impl-item info
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem;
|
||||
@ -312,7 +311,6 @@ impl CrateStore for DummyCrateStore {
|
||||
|
||||
// impl info
|
||||
fn impl_defaultness(&self, def: DefId) -> hir::Defaultness { bug!("impl_defaultness") }
|
||||
fn impl_parent(&self, def: DefId) -> Option<DefId> { bug!("impl_parent") }
|
||||
|
||||
// trait/impl-item info
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
|
||||
|
@ -347,6 +347,12 @@ impl<'tcx> QueryDescription for queries::fn_arg_names<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> QueryDescription for queries::impl_parent<'tcx> {
|
||||
fn describe(_: TyCtxt, _: DefId) -> String {
|
||||
bug!("impl_parent")
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> QueryDescription for queries::trait_of_item<'tcx> {
|
||||
fn describe(_: TyCtxt, _: DefId) -> String {
|
||||
bug!("trait_of_item")
|
||||
@ -804,6 +810,7 @@ define_maps! { <'tcx>
|
||||
[] deprecation: Deprecation(DefId) -> Option<attr::Deprecation>,
|
||||
[] item_attrs: ItemAttrs(DefId) -> Rc<[ast::Attribute]>,
|
||||
[] fn_arg_names: FnArgNames(DefId) -> Vec<ast::Name>,
|
||||
[] impl_parent: ImplParent(DefId) -> Option<DefId>,
|
||||
[] trait_of_item: TraitOfItem(DefId) -> Option<DefId>,
|
||||
[] item_body_nested_bodies: ItemBodyNestedBodies(DefId) -> Rc<BTreeMap<hir::BodyId, hir::Body>>,
|
||||
[] const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic(DefId) -> bool,
|
||||
|
@ -2393,7 +2393,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
||||
let trait_ref = self.impl_trait_ref(impl_def_id).unwrap();
|
||||
|
||||
// Record the trait->implementation mapping.
|
||||
let parent = self.sess.cstore.impl_parent(impl_def_id).unwrap_or(trait_id);
|
||||
let parent = self.impl_parent(impl_def_id).unwrap_or(trait_id);
|
||||
def.record_remote_impl(self, impl_def_id, trait_ref, parent);
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,7 @@ provide! { <'tcx> tcx, def_id, cdata
|
||||
// This is only used by rustdoc anyway, which shouldn't have
|
||||
// incremental recompilation ever enabled.
|
||||
fn_arg_names => { cdata.get_fn_arg_names(def_id.index) }
|
||||
impl_parent => { cdata.get_parent_impl(def_id.index) }
|
||||
trait_of_item => { cdata.get_trait_of_item(def_id.index) }
|
||||
item_body_nested_bodies => {
|
||||
let map: BTreeMap<_, _> = cdata.entry(def_id.index).ast.into_iter().flat_map(|ast| {
|
||||
@ -170,11 +171,6 @@ impl CrateStore for cstore::CStore {
|
||||
self.get_crate_data(def.krate).get_impl_defaultness(def.index)
|
||||
}
|
||||
|
||||
fn impl_parent(&self, impl_def: DefId) -> Option<DefId> {
|
||||
self.dep_graph.read(DepNode::MetaData(impl_def));
|
||||
self.get_crate_data(impl_def.krate).get_parent_impl(impl_def.index)
|
||||
}
|
||||
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
|
||||
{
|
||||
self.dep_graph.read(DepNode::MetaData(def));
|
||||
|
Loading…
x
Reference in New Issue
Block a user