Skip to content

Commit 05f6890

Browse files
Rename arg_iter to iter_instantiated
1 parent 4eaad89 commit 05f6890

File tree

20 files changed

+47
-40
lines changed

20 files changed

+47
-40
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
695695
.find_map(find_fn_kind_from_did),
696696
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => tcx
697697
.explicit_item_bounds(def_id)
698-
.arg_iter_copied(tcx, args)
698+
.iter_instantiated_copied(tcx, args)
699699
.find_map(|(clause, span)| find_fn_kind_from_did((clause, span))),
700700
ty::Closure(_, args) => match args.as_closure().kind() {
701701
ty::ClosureKind::Fn => Some(hir::Mutability::Not),

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
867867
});
868868
self.types.insert(proj.def_id, (infer_ty, proj.args));
869869
// Recurse into bounds
870-
for (pred, pred_span) in self.interner().explicit_item_bounds(proj.def_id).arg_iter_copied(self.interner(), proj.args) {
870+
for (pred, pred_span) in self.interner().explicit_item_bounds(proj.def_id).iter_instantiated_copied(self.interner(), proj.args) {
871871
let pred = pred.fold_with(self);
872872
let pred = self.ocx.normalize(
873873
&ObligationCause::misc(self.span, self.body_id),
@@ -2149,7 +2149,7 @@ pub(super) fn check_type_bounds<'tcx>(
21492149

21502150
let obligations: Vec<_> = tcx
21512151
.explicit_item_bounds(trait_ty.def_id)
2152-
.arg_iter_copied(tcx, rebased_args)
2152+
.iter_instantiated_copied(tcx, rebased_args)
21532153
.map(|(concrete_ty_bound, span)| {
21542154
debug!("check_type_bounds: concrete_ty_bound = {:?}", concrete_ty_bound);
21552155
traits::Obligation::new(tcx, mk_cause(span), param_env, concrete_ty_bound)

compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ fn fn_sig_suggestion<'tcx>(
409409
let asyncness = if tcx.asyncness(assoc.def_id).is_async() {
410410
output = if let ty::Alias(_, alias_ty) = *output.kind() {
411411
tcx.explicit_item_bounds(alias_ty.def_id)
412-
.arg_iter_copied(tcx, alias_ty.args)
412+
.iter_instantiated_copied(tcx, alias_ty.args)
413413
.find_map(|(bound, _)| bound.as_projection_clause()?.no_bound_vars()?.term.ty())
414414
.unwrap_or_else(|| {
415415
span_bug!(

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
15671567
});
15681568
for (bound, bound_span) in tcx
15691569
.explicit_item_bounds(opaque_ty.def_id)
1570-
.arg_iter_copied(tcx, opaque_ty.args)
1570+
.iter_instantiated_copied(tcx, opaque_ty.args)
15711571
{
15721572
let bound = self.wfcx.normalize(bound_span, None, bound);
15731573
self.wfcx.register_obligations(traits::wf::predicate_obligations(

compiler/rustc_hir_analysis/src/variance/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
145145
let mut collector =
146146
OpaqueTypeLifetimeCollector { tcx, root_def_id: item_def_id.to_def_id(), variances };
147147
let id_args = ty::GenericArgs::identity_for_item(tcx, item_def_id);
148-
for (pred, _) in tcx.explicit_item_bounds(item_def_id).arg_iter_copied(tcx, id_args) {
148+
for (pred, _) in tcx.explicit_item_bounds(item_def_id).iter_instantiated_copied(tcx, id_args) {
149149
debug!(?pred);
150150

151151
// We only ignore opaque type args if the opaque type is the outermost type.

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
551551
}
552552

553553
for ty in [first_ty, second_ty] {
554-
for (clause, _) in
555-
self.tcx.explicit_item_bounds(rpit_def_id).arg_iter_copied(self.tcx, args)
554+
for (clause, _) in self
555+
.tcx
556+
.explicit_item_bounds(rpit_def_id)
557+
.iter_instantiated_copied(self.tcx, args)
556558
{
557559
let pred = clause.kind().rebind(match clause.kind().skip_binder() {
558560
ty::ClauseKind::Trait(trait_pred) => {

compiler/rustc_hir_typeck/src/closure.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
177177
expected_ty,
178178
self.tcx
179179
.explicit_item_bounds(def_id)
180-
.arg_iter_copied(self.tcx, args)
180+
.iter_instantiated_copied(self.tcx, args)
181181
.map(|(c, s)| (c.as_predicate(), s)),
182182
),
183183
ty::Dynamic(ref object_type, ..) => {
@@ -720,13 +720,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
720720
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => self
721721
.tcx
722722
.explicit_item_bounds(def_id)
723-
.arg_iter_copied(self.tcx, args)
723+
.iter_instantiated_copied(self.tcx, args)
724724
.find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
725725
ty::Error(_) => return None,
726726
ty::Alias(ty::Projection, proj) if self.tcx.is_impl_trait_in_trait(proj.def_id) => self
727727
.tcx
728728
.explicit_item_bounds(proj.def_id)
729-
.arg_iter_copied(self.tcx, proj.args)
729+
.iter_instantiated_copied(self.tcx, proj.args)
730730
.find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
731731
_ => span_bug!(
732732
self.tcx.def_span(expr_def_id),

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ impl<'tcx> InferCtxt<'tcx> {
403403
let future_trait = self.tcx.require_lang_item(LangItem::Future, None);
404404
let item_def_id = self.tcx.associated_item_def_ids(future_trait)[0];
405405

406-
self.tcx.explicit_item_bounds(def_id).arg_iter_copied(self.tcx, args).find_map(
406+
self.tcx.explicit_item_bounds(def_id).iter_instantiated_copied(self.tcx, args).find_map(
407407
|(predicate, _)| {
408408
predicate
409409
.kind()

compiler/rustc_infer/src/infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl<'tcx> InferCtxt<'tcx> {
591591
let tcx = self.tcx;
592592
let item_bounds = tcx.explicit_item_bounds(def_id);
593593

594-
for (predicate, _) in item_bounds.arg_iter_copied(tcx, args) {
594+
for (predicate, _) in item_bounds.iter_instantiated_copied(tcx, args) {
595595
let predicate = predicate.fold_with(&mut BottomUpFolder {
596596
tcx,
597597
ty_op: |ty| match *ty.kind() {

compiler/rustc_infer/src/infer/outlives/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
295295
let bounds = tcx.item_bounds(alias_ty.def_id);
296296
trace!("{:#?}", bounds.skip_binder());
297297
bounds
298-
.arg_iter(tcx, alias_ty.args)
298+
.iter_instantiated(tcx, alias_ty.args)
299299
.filter_map(|p| p.as_type_outlives_clause())
300300
.filter_map(|p| p.no_bound_vars())
301301
.map(|OutlivesPredicate(_, r)| r)

0 commit comments

Comments
 (0)