Skip to content

Commit

Permalink
Revert "Don't use global caches if opaques can be defined"
Browse files Browse the repository at this point in the history
This reverts commit 61b5e11.
  • Loading branch information
lqd committed Oct 23, 2024
1 parent ffd978b commit 9f4b978
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
return false;
}

// Avoid using the global cache during coherence and just rely
// Avoid using the master cache during coherence and just rely
// on the local cache. This effectively disables caching
// during coherence. It is really just a simplification to
// avoid us having to fear that coherence results "pollute"
Expand All @@ -1498,12 +1498,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
return false;
}

// Avoid using the global cache when we're defining opaque types
// as their hidden type may impact the result of candidate selection.
if !self.infcx.defining_opaque_types().is_empty() {
return false;
}

// Otherwise, we can use the global cache.
true
}
Expand Down

0 comments on commit 9f4b978

Please sign in to comment.