mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
add subst_identity_iter and subst_identity_iter_copied methods on EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
This commit is contained in:
parent
097309c10f
commit
55d8146334
1 changed files with 1 additions and 2 deletions
|
@ -90,8 +90,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for bound in cx.tcx.explicit_item_bounds(def_id).transpose_iter() {
|
for (predicate, _span) in cx.tcx.explicit_item_bounds(def_id).subst_identity_iter_copied() {
|
||||||
let (predicate, _span) = bound.map_bound(|b| *b).subst_identity();
|
|
||||||
match predicate.kind().skip_binder() {
|
match predicate.kind().skip_binder() {
|
||||||
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
|
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
|
||||||
// and check substituions to find `U`.
|
// and check substituions to find `U`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue