@@ -9,6 +9,7 @@ use crate::fx::FxHashSet;
9
9
use crate :: graph:: vec_graph:: VecGraph ;
10
10
use crate :: graph:: { DirectedGraph , GraphSuccessors , WithNumEdges , WithNumNodes , WithSuccessors } ;
11
11
use rustc_index:: vec:: { Idx , IndexVec } ;
12
+ use std:: cmp:: Ord ;
12
13
use std:: ops:: Range ;
13
14
14
15
#[ cfg( test) ]
@@ -38,7 +39,7 @@ struct SccData<S: Idx> {
38
39
all_successors : Vec < S > ,
39
40
}
40
41
41
- impl < N : Idx , S : Idx > Sccs < N , S > {
42
+ impl < N : Idx , S : Idx + Ord > Sccs < N , S > {
42
43
pub fn new ( graph : & ( impl DirectedGraph < Node = N > + WithNumNodes + WithSuccessors ) ) -> Self {
43
44
SccsConstruction :: construct ( graph)
44
45
}
@@ -85,7 +86,7 @@ impl<N: Idx, S: Idx> DirectedGraph for Sccs<N, S> {
85
86
type Node = S ;
86
87
}
87
88
88
- impl < N : Idx , S : Idx > WithNumNodes for Sccs < N , S > {
89
+ impl < N : Idx , S : Idx + Ord > WithNumNodes for Sccs < N , S > {
89
90
fn num_nodes ( & self ) -> usize {
90
91
self . num_sccs ( )
91
92
}
@@ -103,7 +104,7 @@ impl<'graph, N: Idx, S: Idx> GraphSuccessors<'graph> for Sccs<N, S> {
103
104
type Iter = std:: iter:: Cloned < std:: slice:: Iter < ' graph , S > > ;
104
105
}
105
106
106
- impl < N : Idx , S : Idx > WithSuccessors for Sccs < N , S > {
107
+ impl < N : Idx , S : Idx + Ord > WithSuccessors for Sccs < N , S > {
107
108
fn successors ( & self , node : S ) -> <Self as GraphSuccessors < ' _ > >:: Iter {
108
109
self . successors ( node) . iter ( ) . cloned ( )
109
110
}
0 commit comments