File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/librustc_data_structures/obligation_forest Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -300,9 +300,10 @@ impl<O: ForestObligation> ObligationForest<O> {
300300
301301 match self . active_cache . entry ( obligation. as_predicate ( ) . clone ( ) ) {
302302 Entry :: Occupied ( o) => {
303+ let index = * o. get ( ) ;
303304 debug ! ( "register_obligation_at({:?}, {:?}) - duplicate of {:?}!" ,
304- obligation, parent, o . get ( ) ) ;
305- let node = & mut self . nodes [ * o . get ( ) ] ;
305+ obligation, parent, index ) ;
306+ let node = & mut self . nodes [ index ] ;
306307 if let Some ( parent_index) = parent {
307308 // If the node is already in `active_cache`, it has already
308309 // had its chance to be marked with a parent. So if it's
@@ -337,7 +338,8 @@ impl<O: ForestObligation> ObligationForest<O> {
337338 if already_failed {
338339 Err ( ( ) )
339340 } else {
340- v. insert ( self . nodes . len ( ) ) ;
341+ let new_index = self . nodes . len ( ) ;
342+ v. insert ( new_index) ;
341343 self . nodes . push ( Node :: new ( parent, obligation, obligation_tree_id) ) ;
342344 Ok ( ( ) )
343345 }
You can’t perform that action at this time.
0 commit comments