Skip to content

Commit 3f8b936

Browse files
committed
Auto merge of #42537 - michaelwoerister:tcx-for-dep-node, r=nikomatsakis
incr.comp.: Make DepNode `Copy` and valid across compilation sessions This PR moves `DepNode` to a representation that does not need retracing and thus simplifies comparing dep-graphs from different compilation sessions. The code also gets a lot simpler in many places, since we don't need the generic parameter on `DepNode` anymore. See #42294 for details. ~~NOTE: Only the last commit of this is new, the rest is already reviewed in #42504 This PR is almost done but there are some things I still want to do: - [x] Add some module-level documentation to `dep_node.rs`, explaining especially what the `define_dep_nodes!()` macro is about. - [x] Do another pass over the dep-graph loading logic. I suspect that we can get rid of building the `edges` map and also use arrays instead of hash maps in some places. cc @rust-lang/compiler r? @nikomatsakis
2 parents 0a5218b + fdff2d3 commit 3f8b936

39 files changed

+1007
-785
lines changed

src/librustc/dep_graph/debug.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
use super::dep_node::DepNode;
1414
use std::error::Error;
15-
use std::fmt::Debug;
1615

1716
/// A dep-node filter goes from a user-defined string to a query over
1817
/// nodes. Right now the format is like this:
@@ -39,7 +38,7 @@ impl DepNodeFilter {
3938
}
4039

4140
/// Tests whether `node` meets the filter, returning true if so.
42-
pub fn test<D: Clone + Debug>(&self, node: &DepNode<D>) -> bool {
41+
pub fn test(&self, node: &DepNode) -> bool {
4342
let debug_str = format!("{:?}", node);
4443
self.text.split("&")
4544
.map(|s| s.trim())
@@ -67,10 +66,10 @@ impl EdgeFilter {
6766
}
6867
}
6968

70-
pub fn test<D: Clone + Debug>(&self,
71-
source: &DepNode<D>,
72-
target: &DepNode<D>)
73-
-> bool {
69+
pub fn test(&self,
70+
source: &DepNode,
71+
target: &DepNode)
72+
-> bool {
7473
self.source.test(source) && self.target.test(target)
7574
}
7675
}

0 commit comments

Comments
 (0)