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

@ -76,9 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
// For every projection predicate in the opaque type's explicit bounds,
// check that the type that we're assigning actually satisfies the bounds
// of the associated type.
for (pred, pred_span) in
cx.tcx.explicit_item_bounds(def_id).instantiate_identity_iter_copied()
{
for (pred, pred_span) in cx.tcx.explicit_item_bounds(def_id).iter_identity_copied() {
infcx.enter_forall(pred.kind(), |predicate| {
let ty::ClauseKind::Projection(proj) = predicate else {
return;

View file

@ -298,9 +298,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
ty::Alias(ty::Opaque | ty::Projection, ty::AliasTy { def_id: def, .. }) => {
elaborate(
cx.tcx,
cx.tcx
.explicit_item_super_predicates(def)
.instantiate_identity_iter_copied(),
cx.tcx.explicit_item_super_predicates(def).iter_identity_copied(),
)
// We only care about self bounds for the impl-trait
.filter_only_self()