]> git.lizzy.rs Git - rust.git/commitdiff
Remove `Hir` and `HirBody` dep nodes
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 8 Feb 2020 04:30:45 +0000 (05:30 +0100)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 14 Mar 2020 21:52:30 +0000 (22:52 +0100)
src/librustc/dep_graph/dep_node.rs
src/librustc/dep_graph/graph.rs
src/librustc/hir/map/collector.rs
src/librustc/hir/map/hir_id_validator.rs
src/librustc/ty/query/mod.rs
src/librustc_incremental/assert_dep_graph.rs
src/librustc_incremental/persist/dirty_clean.rs

index 36b5f4de099e39e1f8ddadf53453443e85e7ebda..e3df9d5d04be106727dd783d97e5a3103931a1aa 100644 (file)
@@ -341,13 +341,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     // We use this for most things when incr. comp. is turned off.
     [] Null,
 
-    // Represents the body of a function or method. The def-id is that of the
-    // function/method.
-    [eval_always] HirBody(DefId),
-
-    // Represents the HIR node with the given node-id
-    [eval_always] Hir(DefId),
-
     // Represents metadata from an extern crate.
     [eval_always] CrateMetadata(CrateNum),
 
index a2dc1fdb34b78a563b3b650134181f833f01bf25..f5d68e8074dfaf53bc949cca08af9ea787327e8d 100644 (file)
@@ -677,7 +677,7 @@ fn try_mark_previous_green<'tcx>(
                         }
                     } else {
                         match dep_dep_node.kind {
-                            DepKind::Hir | DepKind::HirBody | DepKind::CrateMetadata => {
+                            DepKind::CrateMetadata => {
                                 if let Some(def_id) = dep_dep_node.extract_def_id(tcx) {
                                     if def_id_corresponds_to_hir_dep_node(tcx, def_id) {
                                         // The `DefPath` has corresponding node,
index b9ab43ed289ca193de064daf8fb7d65b28f0b4b8..ee5192f58c2bd909b876e682ca3083e4a995929d 100644 (file)
@@ -44,7 +44,7 @@ pub(super) struct NodeCollector<'a, 'hir> {
 
     hcx: StableHashingContext<'a>,
 
-    // We are collecting `DepNode::HirBody` hashes here so we can compute the
+    // We are collecting HIR hashes here so we can compute the
     // crate hash from them later on.
     hir_body_nodes: Vec<(DefPathHash, Fingerprint)>,
 }
index 0c6415a1308a5be761df4e7f1defb3797ce12166..6792c00e763e1e667206189ed1d78a48f4af54e1 100644 (file)
@@ -7,7 +7,7 @@
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_hir::{HirId, ItemLocalId};*/
 
-pub fn check_crate(hir_map: &EarlyMap<'_>, sess: &rustc_session::Session) {
+pub fn check_crate(_: &EarlyMap<'_>, sess: &rustc_session::Session) {
     /*hir_map.dep_graph.assert_ignored();
 
     let errors = Lock::new(Vec::new());
index d1141a489901c93ba80e28a232c0221067b1bbc9..3d17883fec3bd3e8090a519e96db207f3c0ffa6a 100644 (file)
@@ -180,8 +180,6 @@ pub fn force_from_dep_node<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> bool
         // These are inputs that are expected to be pre-allocated and that
         // should therefore always be red or green already.
         DepKind::CrateMetadata |
-        DepKind::HirBody |
-        DepKind::Hir |
 
         // These are anonymous nodes.
         DepKind::TraitSelect |
index 7686a507ff5266f742547e0598a4ed6c15939710..7ddb29c3cb621cf2379d5309f6c9387a63630d8f 100644 (file)
@@ -120,7 +120,7 @@ fn process_attrs(&mut self, hir_id: hir::HirId, attrs: &[ast::Attribute]) {
             if attr.check_name(sym::rustc_if_this_changed) {
                 let dep_node_interned = self.argument(attr);
                 let dep_node = match dep_node_interned {
-                    None => DepNode::from_def_path_hash(def_path_hash, DepKind::Hir),
+                    None => DepNode::from_def_path_hash(def_path_hash, DepKind::hir_owner),
                     Some(n) => match DepNode::from_label_string(&n.as_str(), def_path_hash) {
                         Ok(n) => n,
                         Err(()) => {
index c90b5abfe30e50944e84d89825f672d3eb0f314d..bb77309d32bb0b9820d91f556d8c70ce09517523 100644 (file)
@@ -54,8 +54,7 @@
 /// DepNodes for Hir, which is pretty much everything
 const BASE_HIR: &[&str] = &[
     // Hir and HirBody should be computed for all nodes
-    label_strs::Hir,
-    label_strs::HirBody,
+    "Hir", "HirBody",
 ];
 
 /// `impl` implementation of struct/trait