@@ -12,7 +12,7 @@ use rustc_index::{Idx, IndexVec};
1212use rustc_middle:: mir:: coverage:: Op ;
1313
1414use crate :: coverage:: counters:: iter_nodes:: IterNodes ;
15- use crate :: coverage:: counters:: union_find:: { FrozenUnionFind , UnionFind } ;
15+ use crate :: coverage:: counters:: union_find:: UnionFind ;
1616
1717#[ cfg( test) ]
1818mod tests;
@@ -32,7 +32,7 @@ mod tests;
3232pub ( crate ) struct MergedNodeFlowGraph < Node : Idx > {
3333 /// Maps each node to the supernode that contains it, indicated by some
3434 /// arbitrary "root" node that is part of that supernode.
35- supernodes : FrozenUnionFind < Node > ,
35+ supernodes : IndexVec < Node , Node > ,
3636 /// For each node, stores the single supernode that all of its successors
3737 /// have been merged into.
3838 ///
@@ -66,11 +66,11 @@ impl<Node: Idx> MergedNodeFlowGraph<Node> {
6666 } )
6767 . collect :: < IndexVec < G :: Node , G :: Node > > ( ) ;
6868
69- // Now that unification is complete, freeze the supernode forest,
69+ // Now that unification is complete, take a snapshot of the supernode forest,
7070 // and resolve each arbitrarily-chosen successor to its canonical root.
7171 // (This avoids having to explicitly resolve them later.)
72- let supernodes = supernodes. freeze ( ) ;
73- let succ_supernodes = successors. into_iter ( ) . map ( |succ| supernodes. find ( succ) ) . collect ( ) ;
72+ let supernodes = supernodes. snapshot ( ) ;
73+ let succ_supernodes = successors. into_iter ( ) . map ( |succ| supernodes[ succ] ) . collect ( ) ;
7474
7575 Self { supernodes, succ_supernodes }
7676 }
@@ -80,7 +80,7 @@ impl<Node: Idx> MergedNodeFlowGraph<Node> {
8080 }
8181
8282 fn is_supernode ( & self , node : Node ) -> bool {
83- self . supernodes . find ( node) == node
83+ self . supernodes [ node] == node
8484 }
8585
8686 /// Using the information in this merged graph, together with a given
@@ -225,7 +225,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> {
225225
226226 // Get the supernode containing `this`, and make it the root of its
227227 // component of the spantree.
228- let this_supernode = self . graph . supernodes . find ( this) ;
228+ let this_supernode = self . graph . supernodes [ this] ;
229229 self . yank_to_spantree_root ( this_supernode) ;
230230
231231 // Get the supernode containing all of this's successors.
0 commit comments