@@ -9,6 +9,7 @@ use crate::fx::FxHashSet;
99use crate :: graph:: vec_graph:: VecGraph ;
1010use crate :: graph:: { DirectedGraph , GraphSuccessors , WithNumEdges , WithNumNodes , WithSuccessors } ;
1111use rustc_index:: vec:: { Idx , IndexVec } ;
12+ use std:: cmp:: Ord ;
1213use std:: ops:: Range ;
1314
1415#[ cfg( test) ]
@@ -38,7 +39,7 @@ struct SccData<S: Idx> {
3839 all_successors : Vec < S > ,
3940}
4041
41- impl < N : Idx , S : Idx > Sccs < N , S > {
42+ impl < N : Idx , S : Idx + Ord > Sccs < N , S > {
4243 pub fn new ( graph : & ( impl DirectedGraph < Node = N > + WithNumNodes + WithSuccessors ) ) -> Self {
4344 SccsConstruction :: construct ( graph)
4445 }
@@ -85,7 +86,7 @@ impl<N: Idx, S: Idx> DirectedGraph for Sccs<N, S> {
8586 type Node = S ;
8687}
8788
88- impl < N : Idx , S : Idx > WithNumNodes for Sccs < N , S > {
89+ impl < N : Idx , S : Idx + Ord > WithNumNodes for Sccs < N , S > {
8990 fn num_nodes ( & self ) -> usize {
9091 self . num_sccs ( )
9192 }
@@ -103,7 +104,7 @@ impl<'graph, N: Idx, S: Idx> GraphSuccessors<'graph> for Sccs<N, S> {
103104 type Iter = std:: iter:: Cloned < std:: slice:: Iter < ' graph , S > > ;
104105}
105106
106- impl < N : Idx , S : Idx > WithSuccessors for Sccs < N , S > {
107+ impl < N : Idx , S : Idx + Ord > WithSuccessors for Sccs < N , S > {
107108 fn successors ( & self , node : S ) -> <Self as GraphSuccessors < ' _ > >:: Iter {
108109 self . successors ( node) . iter ( ) . cloned ( )
109110 }
0 commit comments