Skip to content

Commit

Permalink
add subst_identity_iter and subst_identity_iter_copied methods on Ear…
Browse files Browse the repository at this point in the history
…lyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
  • Loading branch information
kylematsuda committed Apr 20, 2023
1 parent 097309c commit 55d8146
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
return false;
}

for bound in cx.tcx.explicit_item_bounds(def_id).transpose_iter() {
let (predicate, _span) = bound.map_bound(|b| *b).subst_identity();
for (predicate, _span) in cx.tcx.explicit_item_bounds(def_id).subst_identity_iter_copied() {
match predicate.kind().skip_binder() {
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
// and check substituions to find `U`.
Expand Down

0 comments on commit 55d8146

Please sign in to comment.