DescribeDef(D),
DefSpan(D),
+ Stability(D),
+ Deprecation(D),
}
impl<D: Clone + Debug> DepNode<D> {
}
DescribeDef(ref d) => op(d).map(DescribeDef),
DefSpan(ref d) => op(d).map(DefSpan),
+ Stability(ref d) => op(d).map(Stability),
+ Deprecation(ref d) => op(d).map(Deprecation),
}
}
}
use std::path::PathBuf;
use std::rc::Rc;
use syntax::ast;
-use syntax::attr;
use syntax::ext::base::SyntaxExtension;
use syntax::symbol::Symbol;
use syntax_pos::Span;
fn crate_data_as_rc_any(&self, krate: CrateNum) -> Rc<Any>;
// item info
- fn stability(&self, def: DefId) -> Option<attr::Stability>;
- fn deprecation(&self, def: DefId) -> Option<attr::Deprecation>;
fn visibility(&self, def: DefId) -> ty::Visibility;
fn visible_parent_map<'a>(&'a self) -> ::std::cell::Ref<'a, DefIdMap<DefId>>;
fn item_generics_cloned(&self, def: DefId) -> ty::Generics;
fn crate_data_as_rc_any(&self, krate: CrateNum) -> Rc<Any>
{ bug!("crate_data_as_rc_any") }
// item info
- fn stability(&self, def: DefId) -> Option<attr::Stability> { bug!("stability") }
- fn deprecation(&self, def: DefId) -> Option<attr::Deprecation> { bug!("deprecation") }
fn visibility(&self, def: DefId) -> ty::Visibility { bug!("visibility") }
fn visible_parent_map<'a>(&'a self) -> ::std::cell::Ref<'a, DefIdMap<DefId>> {
bug!("visible_parent_map")
if id.is_local() {
None // The stability cache is filled partially lazily
} else {
- self.sess.cstore.stability(id).map(|st| self.intern_stability(st))
+ self.stability(id).map(|st| self.intern_stability(st))
}
}
if id.is_local() {
None // The stability cache is filled partially lazily
} else {
- self.sess.cstore.deprecation(id).map(DeprecationEntry::external)
+ self.deprecation(id).map(DeprecationEntry::external)
}
}
}
use std::ops::Deref;
use std::rc::Rc;
use syntax_pos::{Span, DUMMY_SP};
+use syntax::attr;
use syntax::symbol::Symbol;
trait Key {
}
}
+
+impl<'tcx> QueryDescription for queries::stability<'tcx> {
+ fn describe(_: TyCtxt, _: DefId) -> String {
+ bug!("stability")
+ }
+}
+
+impl<'tcx> QueryDescription for queries::deprecation<'tcx> {
+ fn describe(_: TyCtxt, _: DefId) -> String {
+ bug!("deprecation")
+ }
+}
+
impl<'tcx> QueryDescription for queries::item_body_nested_bodies<'tcx> {
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
format!("nested item bodies of `{}`", tcx.item_path_str(def_id))
[] describe_def: DescribeDef(DefId) -> Option<Def>,
[] def_span: DefSpan(DefId) -> Span,
-
+ [] stability: Stability(DefId) -> Option<attr::Stability>,
+ [] deprecation: Deprecation(DefId) -> Option<attr::Deprecation>,
[] item_body_nested_bodies: metadata_dep_node(DefId) -> Rc<BTreeMap<hir::BodyId, hir::Body>>,
[] const_is_rvalue_promotable_to_static: metadata_dep_node(DefId) -> bool,
[] is_item_mir_available: metadata_dep_node(DefId) -> bool,
is_foreign_item => { cdata.is_foreign_item(def_id.index) }
describe_def => { cdata.get_def(def_id.index) }
def_span => { cdata.get_span(def_id.index, &tcx.sess) }
+ stability => { cdata.get_stability(def_id.index) }
+ deprecation => { cdata.get_deprecation(def_id.index) }
item_body_nested_bodies => {
let map: BTreeMap<_, _> = cdata.entry(def_id.index).ast.into_iter().flat_map(|ast| {
ast.decode(cdata).nested_bodies.decode(cdata).map(|body| (body.id(), body))
self.get_crate_data(krate)
}
- fn stability(&self, def: DefId) -> Option<attr::Stability> {
- self.dep_graph.read(DepNode::MetaData(def));
- self.get_crate_data(def.krate).get_stability(def.index)
- }
-
- fn deprecation(&self, def: DefId) -> Option<attr::Deprecation> {
- self.dep_graph.read(DepNode::MetaData(def));
- self.get_crate_data(def.krate).get_deprecation(def.index)
- }
-
fn visibility(&self, def: DefId) -> ty::Visibility {
self.dep_graph.read(DepNode::MetaData(def));
self.get_crate_data(def.krate).get_visibility(def.index)