File tree 1 file changed +4
-3
lines changed
compiler/rustc_data_structures/src/obligation_forest
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -336,12 +336,13 @@ impl<O: ForestObligation> ObligationForest<O> {
336
336
337
337
// Returns Err(()) if we already know this obligation failed.
338
338
fn register_obligation_at ( & mut self , obligation : O , parent : Option < usize > ) -> Result < ( ) , ( ) > {
339
- if self . done_cache . contains ( & obligation. as_cache_key ( ) ) {
339
+ let cache_key = obligation. as_cache_key ( ) ;
340
+ if self . done_cache . contains ( & cache_key) {
340
341
debug ! ( "register_obligation_at: ignoring already done obligation: {:?}" , obligation) ;
341
342
return Ok ( ( ) ) ;
342
343
}
343
344
344
- match self . active_cache . entry ( obligation . as_cache_key ( ) ) {
345
+ match self . active_cache . entry ( cache_key . clone ( ) ) {
345
346
Entry :: Occupied ( o) => {
346
347
let node = & mut self . nodes [ * o. get ( ) ] ;
347
348
if let Some ( parent_index) = parent {
@@ -365,7 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
365
366
&& self
366
367
. error_cache
367
368
. get ( & obligation_tree_id)
368
- . map ( |errors| errors. contains ( & obligation . as_cache_key ( ) ) )
369
+ . map ( |errors| errors. contains ( & cache_key ) )
369
370
. unwrap_or ( false ) ;
370
371
371
372
if already_failed {
You can’t perform that action at this time.
0 commit comments