summary refs log tree commit diff
path: root/src/librustc_data_structures/graph/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures/graph/mod.rs')
-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 45e7e5db38f..2787fa3c6b1 100644
--- a/src/librustc_data_structures/graph/mod.rs
+++ b/src/librustc_data_structures/graph/mod.rs
@@ -30,6 +30,13 @@ where
         &'graph self,
         node: Self::Node,
     ) -> <Self as GraphSuccessors<'graph>>::Iter;
+
+    fn depth_first_search(&self, from: Self::Node) -> iterate::DepthFirstSearch<'_, Self>
+    where
+        Self: WithNumNodes,
+    {
+        iterate::DepthFirstSearch::new(self, from)
+    }
 }
 
 pub trait GraphSuccessors<'graph> {