mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 11:04:03 +00:00
rustc: Move impl_defaultness
to a query
This commit is contained in:
parent
dff0c074e4
commit
ed6f868bf7
@ -534,6 +534,7 @@ define_dep_nodes!( <'tcx>
|
||||
[] IsProfilerRuntime(CrateNum),
|
||||
[] GetPanicStrategy(CrateNum),
|
||||
[] IsNoBuiltins(CrateNum),
|
||||
[] ImplDefaultness(DefId),
|
||||
);
|
||||
|
||||
trait DepNodeParams<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> : fmt::Debug {
|
||||
|
@ -236,9 +236,6 @@ pub trait CrateStore {
|
||||
// trait info
|
||||
fn implementations_of_trait(&self, filter: Option<DefId>) -> Vec<DefId>;
|
||||
|
||||
// impl info
|
||||
fn impl_defaultness(&self, def: DefId) -> hir::Defaultness;
|
||||
|
||||
// trait/impl-item info
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem;
|
||||
|
||||
@ -342,9 +339,6 @@ impl CrateStore for DummyCrateStore {
|
||||
// trait info
|
||||
fn implementations_of_trait(&self, filter: Option<DefId>) -> Vec<DefId> { vec![] }
|
||||
|
||||
// impl info
|
||||
fn impl_defaultness(&self, def: DefId) -> hir::Defaultness { bug!("impl_defaultness") }
|
||||
|
||||
// trait/impl-item info
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
|
||||
{ bug!("associated_item_cloned") }
|
||||
|
@ -538,8 +538,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
None => {
|
||||
self.global_tcx()
|
||||
.sess
|
||||
.cstore
|
||||
.impl_defaultness(node_item_def_id)
|
||||
.is_default()
|
||||
}
|
||||
|
@ -1161,6 +1161,8 @@ define_maps! { <'tcx>
|
||||
[] fn in_scope_traits: InScopeTraits(HirId) -> Option<Rc<Vec<TraitCandidate>>>,
|
||||
[] fn module_exports: ModuleExports(HirId) -> Option<Rc<Vec<Export>>>,
|
||||
[] fn lint_levels: lint_levels_node(CrateNum) -> Rc<lint::LintLevelMap>,
|
||||
|
||||
[] fn impl_defaultness: ImplDefaultness(DefId) -> hir::Defaultness,
|
||||
}
|
||||
|
||||
fn type_param_predicates<'tcx>((item_id, param_id): (DefId, DefId)) -> DepConstructor<'tcx> {
|
||||
|
@ -162,6 +162,7 @@ provide! { <'tcx> tcx, def_id, cdata,
|
||||
panic_strategy => { cdata.panic_strategy(&tcx.dep_graph) }
|
||||
extern_crate => { Rc::new(cdata.extern_crate.get()) }
|
||||
is_no_builtins => { cdata.is_no_builtins(&tcx.dep_graph) }
|
||||
impl_defaultness => { cdata.get_impl_defaultness(def_id.index) }
|
||||
}
|
||||
|
||||
pub fn provide_local<'tcx>(providers: &mut Providers<'tcx>) {
|
||||
@ -211,12 +212,6 @@ impl CrateStore for cstore::CStore {
|
||||
result
|
||||
}
|
||||
|
||||
fn impl_defaultness(&self, def: DefId) -> hir::Defaultness
|
||||
{
|
||||
self.read_dep_node(def);
|
||||
self.get_crate_data(def.krate).get_impl_defaultness(def.index)
|
||||
}
|
||||
|
||||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
|
||||
{
|
||||
self.read_dep_node(def);
|
||||
|
Loading…
Reference in New Issue
Block a user