@@ -390,7 +390,7 @@ impl<O: ForestObligation> ObligationForest<O> {
390390 . map ( |( index, _node) | Error { error : error. clone ( ) , backtrace : self . error_at ( index) } )
391391 . collect ( ) ;
392392
393- self . compress ( |_| unreachable ! ( ) ) ;
393+ self . compress ( |_| assert ! ( false ) ) ;
394394 errors
395395 }
396396
@@ -612,7 +612,7 @@ impl<O: ForestObligation> ObligationForest<O> {
612612 fn compress ( & mut self , mut outcome_cb : impl FnMut ( & O ) ) {
613613 let orig_nodes_len = self . nodes . len ( ) ;
614614 let mut node_rewrites: Vec < _ > = std:: mem:: take ( & mut self . reused_node_vec ) ;
615- assert ! ( node_rewrites. is_empty( ) ) ;
615+ debug_assert ! ( node_rewrites. is_empty( ) ) ;
616616 node_rewrites. extend ( 0 ..orig_nodes_len) ;
617617 let mut dead_nodes = 0 ;
618618
@@ -623,13 +623,13 @@ impl<O: ForestObligation> ObligationForest<O> {
623623 // self.nodes[0..index - dead_nodes] are the first remaining nodes
624624 // self.nodes[index - dead_nodes..index] are all dead
625625 // self.nodes[index..] are unchanged
626- for ( index, node_rewrite ) in node_rewrites . iter_mut ( ) . enumerate ( ) {
626+ for index in 0 ..orig_nodes_len {
627627 let node = & self . nodes [ index] ;
628628 match node. state . get ( ) {
629629 NodeState :: Pending | NodeState :: Waiting => {
630630 if dead_nodes > 0 {
631631 self . nodes . swap ( index, index - dead_nodes) ;
632- * node_rewrite -= dead_nodes;
632+ node_rewrites [ index ] -= dead_nodes;
633633 }
634634 }
635635 NodeState :: Done => {
@@ -646,7 +646,7 @@ impl<O: ForestObligation> ObligationForest<O> {
646646 }
647647 // Extract the success stories.
648648 outcome_cb ( & node. obligation ) ;
649- * node_rewrite = orig_nodes_len;
649+ node_rewrites [ index ] = orig_nodes_len;
650650 dead_nodes += 1 ;
651651 }
652652 NodeState :: Error => {
@@ -655,7 +655,7 @@ impl<O: ForestObligation> ObligationForest<O> {
655655 // check against.
656656 self . active_cache . remove ( & node. obligation . as_cache_key ( ) ) ;
657657 self . insert_into_error_cache ( index) ;
658- * node_rewrite = orig_nodes_len;
658+ node_rewrites [ index ] = orig_nodes_len;
659659 dead_nodes += 1 ;
660660 }
661661 NodeState :: Success => unreachable ! ( ) ,
0 commit comments