Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 097309c

Browse files
committed
add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
1 parent afa28e6 commit 097309c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
6464
}
6565
let ret_ty = return_ty(cx, cx.tcx.hir().local_def_id_to_hir_id(fn_def_id).expect_owner());
6666
if let ty::Alias(ty::Opaque, AliasTy { def_id, substs, .. }) = *ret_ty.kind() {
67-
let preds = cx.tcx.bound_explicit_item_bounds(def_id);
67+
let preds = cx.tcx.explicit_item_bounds(def_id);
6868
let mut is_future = false;
6969
for (p, _span) in preds.subst_iter_copied(cx.tcx, substs) {
7070
if let Some(trait_pred) = p.to_opt_poly_trait_pred() {

clippy_utils/src/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
9090
return false;
9191
}
9292

93-
for bound in cx.tcx.bound_explicit_item_bounds(def_id).transpose_iter() {
93+
for bound in cx.tcx.explicit_item_bounds(def_id).transpose_iter() {
9494
let (predicate, _span) = bound.map_bound(|b| *b).subst_identity();
9595
match predicate.kind().skip_binder() {
9696
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
@@ -268,7 +268,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
268268
},
269269
ty::Tuple(substs) => substs.iter().any(|ty| is_must_use_ty(cx, ty)),
270270
ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) => {
271-
for (predicate, _) in cx.tcx.bound_explicit_item_bounds(*def_id).skip_binder() {
271+
for (predicate, _) in cx.tcx.explicit_item_bounds(def_id).skip_binder() {
272272
if let ty::PredicateKind::Clause(ty::Clause::Trait(trait_predicate)) = predicate.kind().skip_binder() {
273273
if cx.tcx.has_attr(trait_predicate.trait_ref.def_id, sym::must_use) {
274274
return true;
@@ -744,7 +744,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: AliasTy<'tcx>) -> Option
744744

745745
for (pred, _) in cx
746746
.tcx
747-
.bound_explicit_item_bounds(ty.def_id)
747+
.explicit_item_bounds(ty.def_id)
748748
.subst_iter_copied(cx.tcx, ty.substs)
749749
{
750750
match pred.kind().skip_binder() {

0 commit comments

Comments
 (0)