about summary refs log tree commit diff
path: root/src/librustc_query_system
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2020-03-21 00:21:57 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2020-03-23 23:15:08 +0100
commit2326ae39b262169fa853c510aa1bc795a166dc26 (patch)
tree68debed64e0ecfc01438fb52f70606bf2e2408a1 /src/librustc_query_system
parentdb7bd5f828faa85880fc3cbac0c7b679e2225321 (diff)
downloadrust-2326ae39b262169fa853c510aa1bc795a166dc26.tar.gz
rust-2326ae39b262169fa853c510aa1bc795a166dc26.zip
Merge ensure_node_can_be_forced into force_from_dep_node.
Diffstat (limited to 'src/librustc_query_system')
-rw-r--r--src/librustc_query_system/dep_graph/graph.rs4
-rw-r--r--src/librustc_query_system/dep_graph/mod.rs7
2 files changed, 3 insertions, 8 deletions
diff --git a/src/librustc_query_system/dep_graph/graph.rs b/src/librustc_query_system/dep_graph/graph.rs
index 5e004c5428a..36edf255a77 100644
--- a/src/librustc_query_system/dep_graph/graph.rs
+++ b/src/librustc_query_system/dep_graph/graph.rs
@@ -635,8 +635,6 @@ impl<K: DepKind> DepGraph<K> {
                             current_deps.push(node_index);
                             continue;
                         }
-                    } else {
-                        tcx.ensure_node_can_be_forced(dep_dep_node)?;
                     }
 
                     // We failed to mark it green, so we try to force the query.
@@ -645,7 +643,7 @@ impl<K: DepKind> DepGraph<K> {
                             dependency {:?}",
                         dep_node, dep_dep_node
                     );
-                    if tcx.force_from_dep_node(dep_dep_node) {
+                    if tcx.try_force_previous_green(dep_dep_node) {
                         let dep_dep_node_color = data.colors.get(dep_dep_node_index);
 
                         match dep_dep_node_color {
diff --git a/src/librustc_query_system/dep_graph/mod.rs b/src/librustc_query_system/dep_graph/mod.rs
index 77bc8f61293..c9983013d38 100644
--- a/src/librustc_query_system/dep_graph/mod.rs
+++ b/src/librustc_query_system/dep_graph/mod.rs
@@ -31,8 +31,8 @@ pub trait DepContext: Copy {
     /// Create a hashing context for hashing new results.
     fn create_stable_hashing_context(&self) -> Self::StableHashingContext;
 
-    /// Force the execution of a query given the associated `DepNode`.
-    fn force_from_dep_node(&self, node: &DepNode<Self::DepKind>) -> bool;
+    /// Try to force a dep node to execute and see if it's green.
+    fn try_force_previous_green(&self, node: &DepNode<Self::DepKind>) -> bool;
 
     /// Extracts the DefId corresponding to this DepNode. This will work
     /// if two conditions are met:
@@ -46,9 +46,6 @@ pub trait DepContext: Copy {
     /// has been removed.
     fn extract_def_id(&self, node: &DepNode<Self::DepKind>) -> Option<DefId>;
 
-    /// Check the legality of forcing this node.
-    fn ensure_node_can_be_forced(&self, dep_dep_node: &DepNode<Self::DepKind>) -> Option<()>;
-
     /// Return whether the current session is tainted by errors.
     fn has_errors_or_delayed_span_bugs(&self) -> bool;