Skip to content

Commit d17ae64

Browse files
committed
use global cache when defining opaque types
the compile time impact is too great for a theoretical issue. This basically reverts commit 61b5e11
1 parent fbab782 commit d17ae64

File tree

1 file changed

+7
-3
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+7
-3
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1492,9 +1492,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
14921492
// it's not worth going to more trouble to increase the
14931493
// hit-rate, I don't think.
14941494
TypingMode::Coherence => false,
1495-
// Avoid using the global cache when we're defining opaque types
1496-
// as their hidden type may impact the result of candidate selection.
1497-
TypingMode::Analysis { defining_opaque_types } => defining_opaque_types.is_empty(),
1495+
// FIXME(new-solver): This is incorrect, we should not be using the
1496+
// global cache when we're defining opaque types, as their hidden
1497+
// type may impact the result of candidate selection. This is still
1498+
// a theoretical possibility, however, and we have no example of
1499+
// actual unsoundness it can trigger. Until then, not using the
1500+
// cache is too big of a compile-time regression.
1501+
TypingMode::Analysis { .. } => true,
14981502
// The global cache is only used if there are no opaque types in
14991503
// the defining scope or we're outside of analysis.
15001504
//

0 commit comments

Comments
 (0)