@@ -390,7 +390,7 @@ impl<O: ForestObligation> ObligationForest<O> {
390
390
. map ( |( index, _node) | Error { error : error. clone ( ) , backtrace : self . error_at ( index) } )
391
391
. collect ( ) ;
392
392
393
- self . compress ( |_| assert ! ( false ) ) ;
393
+ self . compress ( |_| unreachable ! ( ) ) ;
394
394
errors
395
395
}
396
396
@@ -612,7 +612,7 @@ impl<O: ForestObligation> ObligationForest<O> {
612
612
fn compress ( & mut self , mut outcome_cb : impl FnMut ( & O ) ) {
613
613
let orig_nodes_len = self . nodes . len ( ) ;
614
614
let mut node_rewrites: Vec < _ > = std:: mem:: take ( & mut self . reused_node_vec ) ;
615
- debug_assert ! ( node_rewrites. is_empty( ) ) ;
615
+ assert ! ( node_rewrites. is_empty( ) ) ;
616
616
node_rewrites. extend ( 0 ..orig_nodes_len) ;
617
617
let mut dead_nodes = 0 ;
618
618
@@ -623,13 +623,13 @@ impl<O: ForestObligation> ObligationForest<O> {
623
623
// self.nodes[0..index - dead_nodes] are the first remaining nodes
624
624
// self.nodes[index - dead_nodes..index] are all dead
625
625
// self.nodes[index..] are unchanged
626
- for index in 0 ..orig_nodes_len {
626
+ for ( index, node_rewrite ) in node_rewrites . iter_mut ( ) . enumerate ( ) {
627
627
let node = & self . nodes [ index] ;
628
628
match node. state . get ( ) {
629
629
NodeState :: Pending | NodeState :: Waiting => {
630
630
if dead_nodes > 0 {
631
631
self . nodes . swap ( index, index - dead_nodes) ;
632
- node_rewrites [ index ] -= dead_nodes;
632
+ * node_rewrite -= dead_nodes;
633
633
}
634
634
}
635
635
NodeState :: Done => {
@@ -646,7 +646,7 @@ impl<O: ForestObligation> ObligationForest<O> {
646
646
}
647
647
// Extract the success stories.
648
648
outcome_cb ( & node. obligation ) ;
649
- node_rewrites [ index ] = orig_nodes_len;
649
+ * node_rewrite = orig_nodes_len;
650
650
dead_nodes += 1 ;
651
651
}
652
652
NodeState :: Error => {
@@ -655,7 +655,7 @@ impl<O: ForestObligation> ObligationForest<O> {
655
655
// check against.
656
656
self . active_cache . remove ( & node. obligation . as_cache_key ( ) ) ;
657
657
self . insert_into_error_cache ( index) ;
658
- node_rewrites [ index ] = orig_nodes_len;
658
+ * node_rewrite = orig_nodes_len;
659
659
dead_nodes += 1 ;
660
660
}
661
661
NodeState :: Success => unreachable ! ( ) ,
0 commit comments