diff options
| author | Jubilee <workingjubilee@gmail.com> | 2025-06-13 20:59:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-13 20:59:19 -0700 |
| commit | c3537c2f9e0b4fec409c4817a7773609ecaf596f (patch) | |
| tree | 9f172343c6c8fd23cfc6e59eb8344b3a3dfee49a /compiler/rustc_hir_analysis | |
| parent | 2f5655741808cf4dd049984570a14d811f08fe29 (diff) | |
| parent | b1382020026440c4d289457399fe39ad2707f0ef (diff) | |
| download | rust-c3537c2f9e0b4fec409c4817a7773609ecaf596f.tar.gz rust-c3537c2f9e0b4fec409c4817a7773609ecaf596f.zip | |
Rollup merge of #142441 - compiler-errors:lazier-binder-value-folding, r=lcnr
Delay replacing escaping bound vars in `FindParamInClause` By uplifting the `BoundVarReplacer`, which is used by (e.g.) normalization to replace escaping bound vars that are encountered when folding binders, we can use a similar strategy to delay the instantiation of a binder's contents in the `FindParamInClause` used by the new trait solver. This should alleviate the recently added requirement that `Binder<T>: TypeVisitable` only if `T: TypeFoldable`, which was previously required b/c we were calling `enter_forall` so that we could structurally normalize aliases that we found within the predicates of a param-env clause. r? lcnr
Diffstat (limited to 'compiler/rustc_hir_analysis')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index bdc42c7a2d9..106420faa4c 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -9,8 +9,8 @@ use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::bug; use rustc_middle::ty::{ - self as ty, IsSuggestable, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable, TypeVisitable, - TypeVisitableExt, TypeVisitor, Upcast, + self as ty, IsSuggestable, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, + TypeVisitor, Upcast, }; use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol, kw, sym}; use rustc_trait_selection::traits; @@ -927,7 +927,7 @@ struct GenericParamAndBoundVarCollector<'a, 'tcx> { impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for GenericParamAndBoundVarCollector<'_, 'tcx> { type Result = ControlFlow<ErrorGuaranteed>; - fn visit_binder<T: TypeFoldable<TyCtxt<'tcx>>>( + fn visit_binder<T: TypeVisitable<TyCtxt<'tcx>>>( &mut self, binder: &ty::Binder<'tcx, T>, ) -> Self::Result { |
