about summary refs log tree commit diff
path: root/src/librustc_data_structures/graph
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures/graph')
-rw-r--r--src/librustc_data_structures/graph/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_data_structures/graph/mod.rs b/src/librustc_data_structures/graph/mod.rs
index a5f83ce05f5..474622f3669 100644
--- a/src/librustc_data_structures/graph/mod.rs
+++ b/src/librustc_data_structures/graph/mod.rs
@@ -114,6 +114,13 @@ impl<N: Debug, E: Debug> Graph<N, E> {
         }
     }
 
+    pub fn with_capacity(nodes: usize, edges: usize) -> Graph<N, E> {
+        Graph {
+            nodes: SnapshotVec::with_capacity(nodes),
+            edges: SnapshotVec::with_capacity(edges),
+        }
+    }
+
     // # Simple accessors
 
     #[inline]