iter_identity is a better name

This commit is contained in:
Michael Goulet 2024-07-06 11:54:22 -04:00
parent 289deb9ed7
commit 58aad3c72c
11 changed files with 26 additions and 37 deletions

View file

@ -477,7 +477,7 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, trait_def_id: LocalDefId) {
param_env,
item_def_id,
tcx.explicit_item_bounds(item_def_id)
.instantiate_identity_iter_copied()
.iter_identity_copied()
.collect::<Vec<_>>(),
&FxIndexSet::default(),
gat_def_id,
@ -1204,17 +1204,16 @@ fn check_associated_type_bounds(wfcx: &WfCheckingCtxt<'_, '_>, item: ty::AssocIt
let bounds = wfcx.tcx().explicit_item_bounds(item.def_id);
debug!("check_associated_type_bounds: bounds={:?}", bounds);
let wf_obligations =
bounds.instantiate_identity_iter_copied().flat_map(|(bound, bound_span)| {
let normalized_bound = wfcx.normalize(span, None, bound);
traits::wf::clause_obligations(
wfcx.infcx,
wfcx.param_env,
wfcx.body_def_id,
normalized_bound,
bound_span,
)
});
let wf_obligations = bounds.iter_identity_copied().flat_map(|(bound, bound_span)| {
let normalized_bound = wfcx.normalize(span, None, bound);
traits::wf::clause_obligations(
wfcx.infcx,
wfcx.param_env,
wfcx.body_def_id,
normalized_bound,
bound_span,
)
});
wfcx.register_obligations(wf_obligations);
}