File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/rustc_data_structures/src/obligation_forest Expand file tree Collapse file tree 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> {
336336
337337 // Returns Err(()) if we already know this obligation failed.
338338 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) {
340341 debug ! ( "register_obligation_at: ignoring already done obligation: {:?}" , obligation) ;
341342 return Ok ( ( ) ) ;
342343 }
343344
344- match self . active_cache . entry ( obligation . as_cache_key ( ) ) {
345+ match self . active_cache . entry ( cache_key . clone ( ) ) {
345346 Entry :: Occupied ( o) => {
346347 let node = & mut self . nodes [ * o. get ( ) ] ;
347348 if let Some ( parent_index) = parent {
@@ -365,7 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
365366 && self
366367 . error_cache
367368 . get ( & obligation_tree_id)
368- . map ( |errors| errors. contains ( & obligation . as_cache_key ( ) ) )
369+ . map ( |errors| errors. contains ( & cache_key ) )
369370 . unwrap_or ( false ) ;
370371
371372 if already_failed {
You can’t perform that action at this time.
0 commit comments