File tree 1 file changed +5
-3
lines changed
src/librustc_data_structures/obligation_forest
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> {
300
300
301
301
match self . active_cache . entry ( obligation. as_predicate ( ) . clone ( ) ) {
302
302
Entry :: Occupied ( o) => {
303
+ let index = * o. get ( ) ;
303
304
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 ] ;
306
307
if let Some ( parent_index) = parent {
307
308
// If the node is already in `active_cache`, it has already
308
309
// had its chance to be marked with a parent. So if it's
@@ -337,7 +338,8 @@ impl<O: ForestObligation> ObligationForest<O> {
337
338
if already_failed {
338
339
Err ( ( ) )
339
340
} else {
340
- v. insert ( self . nodes . len ( ) ) ;
341
+ let new_index = self . nodes . len ( ) ;
342
+ v. insert ( new_index) ;
341
343
self . nodes . push ( Node :: new ( parent, obligation, obligation_tree_id) ) ;
342
344
Ok ( ( ) )
343
345
}
You can’t perform that action at this time.
0 commit comments