about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-06-13 20:59:19 -0700
committerGitHub <noreply@github.com>2025-06-13 20:59:19 -0700
commitc3537c2f9e0b4fec409c4817a7773609ecaf596f (patch)
tree9f172343c6c8fd23cfc6e59eb8344b3a3dfee49a /src
parent2f5655741808cf4dd049984570a14d811f08fe29 (diff)
parentb1382020026440c4d289457399fe39ad2707f0ef (diff)
downloadrust-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 'src')
-rw-r--r--src/tools/clippy/clippy_utils/src/ty/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_utils/src/ty/mod.rs b/src/tools/clippy/clippy_utils/src/ty/mod.rs
index 1f0a0f2b02a..32a992ccc2d 100644
--- a/src/tools/clippy/clippy_utils/src/ty/mod.rs
+++ b/src/tools/clippy/clippy_utils/src/ty/mod.rs
@@ -20,7 +20,7 @@ use rustc_middle::traits::EvaluationResult;
 use rustc_middle::ty::layout::ValidityRequirement;
 use rustc_middle::ty::{
     self, AdtDef, AliasTy, AssocItem, AssocTag, Binder, BoundRegion, FnSig, GenericArg, GenericArgKind, GenericArgsRef,
-    GenericParamDefKind, IntTy, Region, RegionKind, TraitRef, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable,
+    GenericParamDefKind, IntTy, Region, RegionKind, TraitRef, Ty, TyCtxt, TypeSuperVisitable,
     TypeVisitable, TypeVisitableExt, TypeVisitor, UintTy, Upcast, VariantDef, VariantDiscr,
 };
 use rustc_span::symbol::Ident;
@@ -853,7 +853,7 @@ pub fn for_each_top_level_late_bound_region<B>(
                 ControlFlow::Continue(())
             }
         }
-        fn visit_binder<T: TypeFoldable<TyCtxt<'tcx>>>(&mut self, t: &Binder<'tcx, T>) -> Self::Result {
+        fn visit_binder<T: TypeVisitable<TyCtxt<'tcx>>>(&mut self, t: &Binder<'tcx, T>) -> Self::Result {
             self.index += 1;
             let res = t.super_visit_with(self);
             self.index -= 1;