Skip to content

Commit 4d7c0b6

Browse files
committed
all queries use dep nodes
1 parent 8305394 commit 4d7c0b6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/librustc/dep_graph/dep_node.rs

+6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ pub enum DepNode<D: Clone + Debug> {
154154
DefSpan(D),
155155
Stability(D),
156156
Deprecation(D),
157+
ItemBodyNestedBodies(D),
158+
ConstIsRvaluePromotableToStatic(D),
159+
IsMirAvailable(D),
157160
}
158161

159162
impl<D: Clone + Debug> DepNode<D> {
@@ -264,6 +267,9 @@ impl<D: Clone + Debug> DepNode<D> {
264267
DefSpan(ref d) => op(d).map(DefSpan),
265268
Stability(ref d) => op(d).map(Stability),
266269
Deprecation(ref d) => op(d).map(Deprecation),
270+
ItemBodyNestedBodies(ref d) => op(d).map(ItemBodyNestedBodies),
271+
ConstIsRvaluePromotableToStatic(ref d) => op(d).map(ConstIsRvaluePromotableToStatic),
272+
IsMirAvailable(ref d) => op(d).map(IsMirAvailable),
267273
}
268274
}
269275
}

src/librustc/ty/maps.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,9 @@ define_maps! { <'tcx>
783783
[] def_span: DefSpan(DefId) -> Span,
784784
[] stability: Stability(DefId) -> Option<attr::Stability>,
785785
[] deprecation: Deprecation(DefId) -> Option<attr::Deprecation>,
786-
[] item_body_nested_bodies: metadata_dep_node(DefId) -> Rc<BTreeMap<hir::BodyId, hir::Body>>,
787-
[] const_is_rvalue_promotable_to_static: metadata_dep_node(DefId) -> bool,
788-
[] is_mir_available: metadata_dep_node(DefId) -> bool,
786+
[] item_body_nested_bodies: ItemBodyNestedBodies(DefId) -> Rc<BTreeMap<hir::BodyId, hir::Body>>,
787+
[] const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic(DefId) -> bool,
788+
[] is_mir_available: IsMirAvailable(DefId) -> bool,
789789
}
790790

791791
fn coherent_trait_dep_node((_, def_id): (CrateNum, DefId)) -> DepNode<DefId> {
@@ -800,10 +800,6 @@ fn reachability_dep_node(_: CrateNum) -> DepNode<DefId> {
800800
DepNode::Reachability
801801
}
802802

803-
fn metadata_dep_node(def_id: DefId) -> DepNode<DefId> {
804-
DepNode::MetaData(def_id)
805-
}
806-
807803
fn mir_shim_dep_node(instance: ty::InstanceDef) -> DepNode<DefId> {
808804
instance.dep_node()
809805
}

0 commit comments

Comments
 (0)