diff options
| author | lcnr <rust@lcnr.de> | 2024-11-26 16:01:08 +0100 | 
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2024-11-28 10:40:58 +0100 | 
| commit | 34a8c2dbba9fe2d57029027781500ab7fc305199 (patch) | |
| tree | 734522c1886ebc2b86d2961fb3cb0b8633ab26fa /compiler/rustc_trait_selection/src/traits/normalize.rs | |
| parent | 18e2253e79fc8a5973a7abfb0fe19f60961338b5 (diff) | |
| download | rust-34a8c2dbba9fe2d57029027781500ab7fc305199.tar.gz rust-34a8c2dbba9fe2d57029027781500ab7fc305199.zip  | |
support revealing defined opaque post borrowck
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/normalize.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/normalize.rs | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/normalize.rs b/compiler/rustc_trait_selection/src/traits/normalize.rs index 4d3d8c66e62..e99c5eacbd8 100644 --- a/compiler/rustc_trait_selection/src/traits/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/normalize.rs @@ -118,9 +118,10 @@ pub(super) fn needs_normalization<'tcx, T: TypeVisitable<TyCtxt<'tcx>>>( // Opaques are treated as rigid outside of `TypingMode::PostAnalysis`, // so we can ignore those. match infcx.typing_mode() { - TypingMode::Coherence | TypingMode::Analysis { defining_opaque_types: _ } => { - flags.remove(ty::TypeFlags::HAS_TY_OPAQUE) - } + // FIXME(#132279): We likely want to reveal opaques during post borrowck analysis + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::PostBorrowckAnalysis { .. } => flags.remove(ty::TypeFlags::HAS_TY_OPAQUE), TypingMode::PostAnalysis => {} } @@ -213,9 +214,10 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx ty::Opaque => { // Only normalize `impl Trait` outside of type inference, usually in codegen. match self.selcx.infcx.typing_mode() { - TypingMode::Coherence | TypingMode::Analysis { defining_opaque_types: _ } => { - ty.super_fold_with(self) - } + // FIXME(#132279): We likely want to reveal opaques during post borrowck analysis + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::PostBorrowckAnalysis { .. } => ty.super_fold_with(self), TypingMode::PostAnalysis => { let recursion_limit = self.cx().recursion_limit(); if !recursion_limit.value_within_limit(self.depth) {  | 
