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
f3b279fcc5
commit
e54854f6a9
12 changed files with 43 additions and 50 deletions
|
@ -318,11 +318,10 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
|
|||
tcx,
|
||||
selftys: vec![],
|
||||
};
|
||||
let prohibit_opaque =
|
||||
tcx.explicit_item_bounds(def_id).transpose_iter().try_for_each(|bound| {
|
||||
let predicate = bound.map_bound(|&(predicate, _)| predicate).subst_identity();
|
||||
predicate.visit_with(&mut visitor)
|
||||
});
|
||||
let prohibit_opaque = tcx
|
||||
.explicit_item_bounds(def_id)
|
||||
.subst_identity_iter_copied()
|
||||
.try_for_each(|(predicate, _)| predicate.visit_with(&mut visitor));
|
||||
|
||||
if let Some(ty) = prohibit_opaque.break_value() {
|
||||
visitor.visit_item(&item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue