]> git.lizzy.rs Git - rust.git/commitdiff
Add a comment to `recover`.
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Mon, 9 Mar 2020 13:50:09 +0000 (14:50 +0100)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Mon, 9 Mar 2020 13:50:40 +0000 (14:50 +0100)
src/librustc/dep_graph/dep_node.rs

index bcb270ff0a64e7a3d72cb08de27b80228eae7e97..156f412e0902ec83aef1749f4063333701b9befb 100644 (file)
@@ -377,6 +377,12 @@ fn to_debug_str(&self, _: TyCtxt<'tcx>) -> String {
         format!("{:?}", self)
     }
 
+    /// This method tries to recover the query key from the given `DepNode`,
+    /// something which is needed when forcing `DepNode`s during red-green
+    /// evaluation. The query system will only call this method if
+    /// `CAN_RECONSTRUCT_QUERY_KEY` is `true`.
+    /// It is always valid to return `None` here, in which case incremental
+    /// compilation will treat the query as having changed instead of forcing it.
     fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>;
 }