3535
3636use crate :: errors;
3737use rustc_ast as ast;
38- use rustc_data_structures:: fx:: FxHashSet ;
38+ use rustc_data_structures:: fx:: FxIndexSet ;
3939use rustc_data_structures:: graph:: implementation:: { Direction , NodeIndex , INCOMING , OUTGOING } ;
4040use rustc_graphviz as dot;
4141use rustc_hir as hir;
@@ -258,7 +258,7 @@ fn dump_graph(query: &DepGraphQuery) {
258258}
259259
260260#[ allow( missing_docs) ]
261- pub struct GraphvizDepGraph ( FxHashSet < DepKind > , Vec < ( DepKind , DepKind ) > ) ;
261+ pub struct GraphvizDepGraph ( FxIndexSet < DepKind > , Vec < ( DepKind , DepKind ) > ) ;
262262
263263impl < ' a > dot:: GraphWalk < ' a > for GraphvizDepGraph {
264264 type Node = DepKind ;
@@ -303,7 +303,7 @@ impl<'a> dot::Labeller<'a> for GraphvizDepGraph {
303303fn node_set < ' q > (
304304 query : & ' q DepGraphQuery ,
305305 filter : & DepNodeFilter ,
306- ) -> Option < FxHashSet < & ' q DepNode > > {
306+ ) -> Option < FxIndexSet < & ' q DepNode > > {
307307 debug ! ( "node_set(filter={:?})" , filter) ;
308308
309309 if filter. accepts_all ( ) {
@@ -315,9 +315,9 @@ fn node_set<'q>(
315315
316316fn filter_nodes < ' q > (
317317 query : & ' q DepGraphQuery ,
318- sources : & Option < FxHashSet < & ' q DepNode > > ,
319- targets : & Option < FxHashSet < & ' q DepNode > > ,
320- ) -> FxHashSet < DepKind > {
318+ sources : & Option < FxIndexSet < & ' q DepNode > > ,
319+ targets : & Option < FxIndexSet < & ' q DepNode > > ,
320+ ) -> FxIndexSet < DepKind > {
321321 if let Some ( sources) = sources {
322322 if let Some ( targets) = targets {
323323 walk_between ( query, sources, targets)
@@ -333,10 +333,10 @@ fn filter_nodes<'q>(
333333
334334fn walk_nodes < ' q > (
335335 query : & ' q DepGraphQuery ,
336- starts : & FxHashSet < & ' q DepNode > ,
336+ starts : & FxIndexSet < & ' q DepNode > ,
337337 direction : Direction ,
338- ) -> FxHashSet < DepKind > {
339- let mut set = FxHashSet :: default ( ) ;
338+ ) -> FxIndexSet < DepKind > {
339+ let mut set = FxIndexSet :: default ( ) ;
340340 for & start in starts {
341341 debug ! ( "walk_nodes: start={:?} outgoing?={:?}" , start, direction == OUTGOING ) ;
342342 if set. insert ( start. kind ) {
@@ -357,9 +357,9 @@ fn walk_nodes<'q>(
357357
358358fn walk_between < ' q > (
359359 query : & ' q DepGraphQuery ,
360- sources : & FxHashSet < & ' q DepNode > ,
361- targets : & FxHashSet < & ' q DepNode > ,
362- ) -> FxHashSet < DepKind > {
360+ sources : & FxIndexSet < & ' q DepNode > ,
361+ targets : & FxIndexSet < & ' q DepNode > ,
362+ ) -> FxIndexSet < DepKind > {
363363 // This is a bit tricky. We want to include a node only if it is:
364364 // (a) reachable from a source and (b) will reach a target. And we
365365 // have to be careful about cycles etc. Luckily efficiency is not
@@ -426,8 +426,8 @@ fn walk_between<'q>(
426426 }
427427}
428428
429- fn filter_edges ( query : & DepGraphQuery , nodes : & FxHashSet < DepKind > ) -> Vec < ( DepKind , DepKind ) > {
430- let uniq: FxHashSet < _ > = query
429+ fn filter_edges ( query : & DepGraphQuery , nodes : & FxIndexSet < DepKind > ) -> Vec < ( DepKind , DepKind ) > {
430+ let uniq: FxIndexSet < _ > = query
431431 . edges ( )
432432 . into_iter ( )
433433 . map ( |( s, t) | ( s. kind , t. kind ) )
0 commit comments