about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2021-01-17 20:20:16 +0100
committerDániel Buga <bugadani@gmail.com>2021-02-10 09:20:41 +0100
commit3c1d792f498ae40eb759d4554540a94612a3df55 (patch)
tree192df65963102dced44a2876532cbf58eb836870 /compiler/rustc_data_structures/src/graph
parentf7534b566c850f860e11735b27a988dd9eec454a (diff)
downloadrust-3c1d792f498ae40eb759d4554540a94612a3df55.tar.gz
rust-3c1d792f498ae40eb759d4554540a94612a3df55.zip
Only initialize what is used
Diffstat (limited to 'compiler/rustc_data_structures/src/graph')
-rw-r--r--compiler/rustc_data_structures/src/graph/dominators/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/graph/dominators/mod.rs b/compiler/rustc_data_structures/src/graph/dominators/mod.rs
index ad62e3c9fc8..1cd170599ba 100644
--- a/compiler/rustc_data_structures/src/graph/dominators/mod.rs
+++ b/compiler/rustc_data_structures/src/graph/dominators/mod.rs
@@ -85,6 +85,10 @@ pub struct Dominators<N: Idx> {
 }
 
 impl<Node: Idx> Dominators<Node> {
+    pub fn dummy() -> Self {
+        Self { post_order_rank: IndexVec::new(), immediate_dominators: IndexVec::new() }
+    }
+
     pub fn is_reachable(&self, node: Node) -> bool {
         self.immediate_dominators[node].is_some()
     }