From d948af1d378e234cb84ba2aedc3f4573a369e7dd Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Wed, 8 Nov 2017 11:44:55 +0100 Subject: [PATCH] incr.comp.: Remove unused DepKind::WorkProduct. --- src/librustc/dep_graph/dep_node.rs | 11 ----------- src/librustc/ty/maps/plumbing.rs | 5 ++--- src/librustc_trans/partitioning.rs | 14 +------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index 57e916e437f4..89ce4bf928ad 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -459,10 +459,6 @@ define_dep_nodes!( <'tcx> // Represents metadata from an extern crate. [input] CrateMetadata(CrateNum), - // Represents some artifact that we save to disk. Note that these - // do not have a def-id as part of their identifier. - [] WorkProduct(WorkProductId), - // Represents different phases in the compiler. [] RegionScopeTree(DefId), [eval_always] Coherence, @@ -781,13 +777,6 @@ impl WorkProductId { hash: fingerprint } } - - pub fn to_dep_node(self) -> DepNode { - DepNode { - kind: DepKind::WorkProduct, - hash: self.hash, - } - } } impl_stable_hash_for!(struct ::dep_graph::WorkProductId { diff --git a/src/librustc/ty/maps/plumbing.rs b/src/librustc/ty/maps/plumbing.rs index 41b701d0d272..24148bcc83f3 100644 --- a/src/librustc/ty/maps/plumbing.rs +++ b/src/librustc/ty/maps/plumbing.rs @@ -721,9 +721,8 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>, DepKind::EraseRegionsTy | DepKind::NormalizeTy | - // These are just odd - DepKind::Null | - DepKind::WorkProduct => { + // This one should never occur in this context + DepKind::Null => { bug!("force_from_dep_node() - Encountered {:?}", dep_node.kind) } diff --git a/src/librustc_trans/partitioning.rs b/src/librustc_trans/partitioning.rs index 6980ba8a5250..03c0f13e2f5f 100644 --- a/src/librustc_trans/partitioning.rs +++ b/src/librustc_trans/partitioning.rs @@ -104,7 +104,7 @@ use collector::InliningMap; use common; -use rustc::dep_graph::{DepNode, WorkProductId}; +use rustc::dep_graph::WorkProductId; use rustc::hir::def_id::DefId; use rustc::hir::map::DefPathData; use rustc::middle::trans::{Linkage, Visibility}; @@ -147,10 +147,6 @@ pub trait CodegenUnitExt<'tcx> { WorkProductId::from_cgu_name(self.name()) } - fn work_product_dep_node(&self) -> DepNode { - self.work_product_id().to_dep_node() - } - fn items_in_deterministic_order<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Vec<(TransItem<'tcx>, @@ -253,14 +249,6 @@ pub fn partition<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>, cgu1.name().cmp(cgu2.name()) }); - if tcx.sess.opts.enable_dep_node_debug_strs() { - for cgu in &result { - let dep_node = cgu.work_product_dep_node(); - tcx.dep_graph.register_dep_node_debug_str(dep_node, - || cgu.name().to_string()); - } - } - result }