From b922ae07b3e62c7b5ead3b9c8d379e8ae2794004 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 20 Oct 2024 03:01:49 +0000 Subject: [PATCH] Make LowerPolyBounds take an IntoIterator --- compiler/rustc_hir_analysis/src/collect/predicates_of.rs | 4 ++-- compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index 421ba40aa88..cdf3cb53e4f 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -267,7 +267,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen let mut bounds = Bounds::default(); icx.lowerer().lower_poly_bounds( ty, - bound_pred.bounds.iter(), + bound_pred.bounds, &mut bounds, bound_vars, PredicateFilter::All, @@ -836,7 +836,7 @@ impl<'tcx> ItemCtxt<'tcx> { let bound_vars = self.tcx.late_bound_vars(predicate.hir_id); self.lowerer().lower_poly_bounds( bound_ty, - predicate.bounds.iter(), + predicate.bounds, &mut bounds, bound_vars, filter, 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 310f648b980..8254e6c7a03 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -142,7 +142,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { /// There is an implied binder around `param_ty` and `hir_bounds`. /// See `lower_poly_trait_ref` for more details. #[instrument(level = "debug", skip(self, hir_bounds, bounds))] - pub(crate) fn lower_poly_bounds<'hir, I: Iterator>>( + pub(crate) fn lower_poly_bounds<'hir, I: IntoIterator>>( &self, param_ty: Ty<'tcx>, hir_bounds: I, @@ -231,7 +231,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { self.lower_poly_bounds( param_ty, - hir_bounds.iter(), + hir_bounds, &mut bounds, ty::List::empty(), predicate_filter, @@ -446,7 +446,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { Ty::new_alias(tcx, ty::Projection, projection_ty.skip_binder()); self.lower_poly_bounds( param_ty, - hir_bounds.iter(), + hir_bounds, bounds, projection_ty.bound_vars(), predicate_filter,