Skip to content

Commit f3b279f

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 0892a73 commit f3b279f

File tree

26 files changed

+49
-56
lines changed

26 files changed

+49
-56
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
706706
.copied()
707707
.find_map(find_fn_kind_from_did),
708708
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => tcx
709-
.bound_explicit_item_bounds(def_id)
709+
.explicit_item_bounds(def_id)
710710
.subst_iter_copied(tcx, substs)
711711
.find_map(find_fn_kind_from_did),
712712
ty::Closure(_, substs) => match substs.as_closure().kind() {

compiler/rustc_hir_analysis/src/check/check.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,8 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
318318
tcx,
319319
selftys: vec![],
320320
};
321-
let prohibit_opaque = tcx
322-
.bound_explicit_item_bounds(def_id.to_def_id())
323-
.transpose_iter()
324-
.try_for_each(|bound| {
321+
let prohibit_opaque =
322+
tcx.explicit_item_bounds(def_id).transpose_iter().try_for_each(|bound| {
325323
let predicate = bound.map_bound(|&(predicate, _)| predicate).subst_identity();
326324
predicate.visit_with(&mut visitor)
327325
});

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
839839
});
840840
self.types.insert(proj.def_id, (infer_ty, proj.substs));
841841
// Recurse into bounds
842-
for (pred, pred_span) in self.interner().bound_explicit_item_bounds(proj.def_id).subst_iter_copied(self.interner(), proj.substs) {
842+
for (pred, pred_span) in self.interner().explicit_item_bounds(proj.def_id).subst_iter_copied(self.interner(), proj.substs) {
843843
let pred = pred.fold_with(self);
844844
let pred = self.ocx.normalize(
845845
&ObligationCause::misc(self.span, self.body_id),
@@ -2023,7 +2023,7 @@ pub(super) fn check_type_bounds<'tcx>(
20232023
};
20242024

20252025
let obligations: Vec<_> = tcx
2026-
.bound_explicit_item_bounds(trait_ty.def_id)
2026+
.explicit_item_bounds(trait_ty.def_id)
20272027
.subst_iter_copied(tcx, rebased_substs)
20282028
.map(|(concrete_ty_bound, span)| {
20292029
debug!("check_type_bounds: concrete_ty_bound = {:?}", concrete_ty_bound);

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, associated_items: &[hir::TraitItemRe
360360
tcx,
361361
param_env,
362362
item_def_id,
363-
tcx.bound_explicit_item_bounds(item_def_id.to_def_id())
363+
tcx.explicit_item_bounds(item_def_id)
364364
.transpose_iter()
365365
.map(|bound| bound.map_bound(|b| *b).subst_identity())
366366
.collect::<Vec<_>>(),
@@ -1125,7 +1125,7 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
11251125
/// Assuming the defaults are used, check that all predicates (bounds on the
11261126
/// assoc type and where clauses on the trait) hold.
11271127
fn check_associated_type_bounds(wfcx: &WfCheckingCtxt<'_, '_>, item: ty::AssocItem, span: Span) {
1128-
let bounds = wfcx.tcx().bound_explicit_item_bounds(item.def_id);
1128+
let bounds = wfcx.tcx().explicit_item_bounds(item.def_id);
11291129

11301130
debug!("check_associated_type_bounds: bounds={:?}", bounds);
11311131
let wf_obligations = bounds.transpose_iter().flat_map(|b| {
@@ -1592,7 +1592,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
15921592
}
15931593
});
15941594
for (bound, bound_span) in tcx
1595-
.bound_explicit_item_bounds(opaque_ty.def_id)
1595+
.explicit_item_bounds(opaque_ty.def_id)
15961596
.subst_iter_copied(tcx, opaque_ty.substs)
15971597
{
15981598
let bound = self.wfcx.normalize(bound_span, None, bound);

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ fn opaque_type_bounds<'tcx>(
7979
pub(super) fn explicit_item_bounds(
8080
tcx: TyCtxt<'_>,
8181
def_id: LocalDefId,
82-
) -> &'_ [(ty::Predicate<'_>, Span)] {
82+
) -> ty::EarlyBinder<&'_ [(ty::Predicate<'_>, Span)]> {
8383
match tcx.opt_rpitit_info(def_id.to_def_id()) {
8484
// RPITIT's bounds are the same as opaque type bounds, but with
8585
// a projection self type.
8686
Some(ty::ImplTraitInTraitData::Trait { opaque_def_id, .. }) => {
8787
let item = tcx.hir().get_by_def_id(opaque_def_id.expect_local()).expect_item();
8888
let opaque_ty = item.expect_opaque_ty();
89-
return opaque_type_bounds(
89+
return ty::EarlyBinder(opaque_type_bounds(
9090
tcx,
9191
opaque_def_id.expect_local(),
9292
opaque_ty.bounds,
@@ -95,15 +95,15 @@ pub(super) fn explicit_item_bounds(
9595
ty::InternalSubsts::identity_for_item(tcx, def_id),
9696
),
9797
item.span,
98-
);
98+
));
9999
}
100100
// These should have been fed!
101101
Some(ty::ImplTraitInTraitData::Impl { .. }) => unreachable!(),
102102
None => {}
103103
}
104104

105105
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
106-
match tcx.hir().get(hir_id) {
106+
let bounds = match tcx.hir().get(hir_id) {
107107
hir::Node::TraitItem(hir::TraitItem {
108108
kind: hir::TraitItemKind::Type(bounds, _),
109109
span,
@@ -123,14 +123,15 @@ pub(super) fn explicit_item_bounds(
123123
opaque_type_bounds(tcx, def_id, bounds, item_ty, *span)
124124
}
125125
_ => bug!("item_bounds called on {:?}", def_id),
126-
}
126+
};
127+
ty::EarlyBinder(bounds)
127128
}
128129

129130
pub(super) fn item_bounds(
130131
tcx: TyCtxt<'_>,
131132
def_id: DefId,
132133
) -> ty::EarlyBinder<&'_ ty::List<ty::Predicate<'_>>> {
133-
tcx.bound_explicit_item_bounds(def_id).map_bound(|bounds| {
134+
tcx.explicit_item_bounds(def_id).map_bound(|bounds| {
134135
tcx.mk_predicates_from_iter(util::elaborate(
135136
tcx,
136137
bounds.iter().map(|&(bound, _span)| bound),

compiler/rustc_hir_analysis/src/variance/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
153153
let mut collector =
154154
OpaqueTypeLifetimeCollector { tcx, root_def_id: item_def_id.to_def_id(), variances };
155155
let id_substs = ty::InternalSubsts::identity_for_item(tcx, item_def_id);
156-
for pred in tcx.bound_explicit_item_bounds(item_def_id.to_def_id()).transpose_iter() {
156+
for pred in tcx.explicit_item_bounds(item_def_id).transpose_iter() {
157157
let pred = pred.map_bound(|(pred, _)| *pred).subst(tcx, id_substs);
158158
debug!(?pred);
159159

compiler/rustc_hir_typeck/src/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
530530
for ty in [first_ty, second_ty] {
531531
for (pred, _) in self
532532
.tcx
533-
.bound_explicit_item_bounds(rpit_def_id)
533+
.explicit_item_bounds(rpit_def_id)
534534
.subst_iter_copied(self.tcx, substs)
535535
{
536536
let pred = pred.kind().rebind(match pred.kind().skip_binder() {

compiler/rustc_hir_typeck/src/closure.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
172172
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => self
173173
.deduce_closure_signature_from_predicates(
174174
expected_ty,
175-
self.tcx.bound_explicit_item_bounds(def_id).subst_iter_copied(self.tcx, substs),
175+
self.tcx.explicit_item_bounds(def_id).subst_iter_copied(self.tcx, substs),
176176
),
177177
ty::Dynamic(ref object_type, ..) => {
178178
let sig = object_type.projection_bounds().find_map(|pb| {
@@ -713,13 +713,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
713713
}
714714
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => self
715715
.tcx
716-
.bound_explicit_item_bounds(def_id)
716+
.explicit_item_bounds(def_id)
717717
.subst_iter_copied(self.tcx, substs)
718718
.find_map(|(p, s)| get_future_output(p, s))?,
719719
ty::Error(_) => return None,
720720
ty::Alias(ty::Projection, proj) if self.tcx.is_impl_trait_in_trait(proj.def_id) => self
721721
.tcx
722-
.bound_explicit_item_bounds(proj.def_id)
722+
.explicit_item_bounds(proj.def_id)
723723
.subst_iter_copied(self.tcx, proj.substs)
724724
.find_map(|(p, s)| get_future_output(p, s))?,
725725
_ => span_bug!(

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ fn check_must_not_suspend_ty<'tcx>(
571571
// FIXME: support adding the attribute to TAITs
572572
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
573573
let mut has_emitted = false;
574-
for bound in fcx.tcx.bound_explicit_item_bounds(def).transpose_iter() {
575-
let predicate = bound.map_bound(|&(predicate, _)| predicate).subst_identity();
574+
for bound in fcx.tcx.explicit_item_bounds(def).transpose_iter() {
575+
let predicate = bound.map_bound(|&(pred, _)| pred).subst_identity();
576576
// We only look at the `DefId`, so it is safe to skip the binder here.
577577
if let ty::PredicateKind::Clause(ty::Clause::Trait(ref poly_trait_predicate)) =
578578
predicate.kind().skip_binder()

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl<'tcx> InferCtxt<'tcx> {
402402
let future_trait = self.tcx.require_lang_item(LangItem::Future, None);
403403
let item_def_id = self.tcx.associated_item_def_ids(future_trait)[0];
404404

405-
self.tcx.bound_explicit_item_bounds(def_id).subst_iter_copied(self.tcx, substs).find_map(
405+
self.tcx.explicit_item_bounds(def_id).subst_iter_copied(self.tcx, substs).find_map(
406406
|(predicate, _)| {
407407
predicate
408408
.kind()

compiler/rustc_infer/src/infer/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl<'tcx> InferCtxt<'tcx> {
540540
.obligations;
541541
}
542542

543-
let item_bounds = tcx.bound_explicit_item_bounds(def_id.to_def_id());
543+
let item_bounds = tcx.explicit_item_bounds(def_id);
544544

545545
for (predicate, _) in item_bounds.subst_iter_copied(tcx, substs) {
546546
let predicate = predicate.fold_with(&mut BottomUpFolder {

compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
7474
// For every projection predicate in the opaque type's explicit bounds,
7575
// check that the type that we're assigning actually satisfies the bounds
7676
// of the associated type.
77-
for bound in cx.tcx.bound_explicit_item_bounds(def_id).transpose_iter() {
77+
for bound in cx.tcx.explicit_item_bounds(def_id).transpose_iter() {
7878
let (pred, pred_span) = bound.map_bound(|b| *b).subst_identity();
7979

8080
// Liberate bound regions in the predicate since we
@@ -114,7 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
114114
// with `impl Send: OtherTrait`.
115115
for (assoc_pred, assoc_pred_span) in cx
116116
.tcx
117-
.bound_explicit_item_bounds(proj.projection_ty.def_id)
117+
.explicit_item_bounds(proj.projection_ty.def_id)
118118
.subst_iter_copied(cx.tcx, &proj.projection_ty.substs)
119119
{
120120
let assoc_pred = assoc_pred.fold_with(proj_replacer);

compiler/rustc_lint/src/unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
257257
elaborate(
258258
cx.tcx,
259259
cx.tcx
260-
.bound_explicit_item_bounds(def)
260+
.explicit_item_bounds(def)
261261
.transpose_iter()
262262
.map(|bound| bound.map_bound(|b| *b).subst_identity()),
263263
)

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ impl IntoArgs for (CrateNum, SimplifiedType) {
203203
}
204204

205205
provide! { tcx, def_id, other, cdata,
206-
explicit_item_bounds => { table_defaulted_array }
206+
explicit_item_bounds => {
207+
let lazy = cdata.root.tables.explicit_item_bounds.get(cdata, def_id.index);
208+
let output = if lazy.is_default() { &mut [] } else { tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx))) };
209+
ty::EarlyBinder(&*output)
210+
}
207211
explicit_predicates_of => { table }
208212
generics_of => { table }
209213
inferred_outlives_of => { table_defaulted_array }

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14251425

14261426
fn encode_explicit_item_bounds(&mut self, def_id: DefId) {
14271427
debug!("EncodeContext::encode_explicit_item_bounds({:?})", def_id);
1428-
let bounds = self.tcx.explicit_item_bounds(def_id);
1428+
let bounds = self.tcx.explicit_item_bounds(def_id).skip_binder();
14291429
record_defaulted_array!(self.tables.explicit_item_bounds[def_id] <- bounds);
14301430
}
14311431

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ rustc_queries! {
274274
/// `key` is the `DefId` of the associated type or opaque type.
275275
///
276276
/// Bounds from the parent (e.g. with nested impl trait) are not included.
277-
query explicit_item_bounds(key: DefId) -> &'tcx [(ty::Predicate<'tcx>, Span)] {
277+
query explicit_item_bounds(key: DefId) -> ty::EarlyBinder<&'tcx [(ty::Predicate<'tcx>, Span)]> {
278278
desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
279279
cache_on_disk_if { key.is_local() }
280280
separate_provide_extern

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ impl<'tcx> TyCtxt<'tcx> {
16111611
let ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) = ty.kind() else { return false };
16121612
let future_trait = self.require_lang_item(LangItem::Future, None);
16131613

1614-
self.bound_explicit_item_bounds(*def_id).skip_binder().iter().any(|(predicate, _)| {
1614+
self.explicit_item_bounds(def_id).skip_binder().iter().any(|(predicate, _)| {
16151615
let ty::PredicateKind::Clause(ty::Clause::Trait(trait_predicate)) = predicate.kind().skip_binder() else {
16161616
return false;
16171617
};

compiler/rustc_middle/src/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ pub trait PrettyPrinter<'tcx>:
911911

912912
// Grab the "TraitA + TraitB" from `impl TraitA + TraitB`,
913913
// by looking up the projections associated with the def_id.
914-
let bounds = tcx.bound_explicit_item_bounds(def_id);
914+
let bounds = tcx.explicit_item_bounds(def_id);
915915

916916
let mut traits = FxIndexMap::default();
917917
let mut fn_traits = FxIndexMap::default();

compiler/rustc_middle/src/ty/util.rs

-7
Original file line numberDiff line numberDiff line change
@@ -694,13 +694,6 @@ impl<'tcx> TyCtxt<'tcx> {
694694
if visitor.found_recursion { Err(expanded_type) } else { Ok(expanded_type) }
695695
}
696696

697-
pub fn bound_explicit_item_bounds(
698-
self,
699-
def_id: DefId,
700-
) -> ty::EarlyBinder<&'tcx [(ty::Predicate<'tcx>, rustc_span::Span)]> {
701-
ty::EarlyBinder(self.explicit_item_bounds(def_id))
702-
}
703-
704697
/// Returns names of captured upvars for closures and generators.
705698
///
706699
/// Here are some examples:

compiler/rustc_mir_transform/src/generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ fn check_must_not_suspend_ty<'tcx>(
18001800
// FIXME: support adding the attribute to TAITs
18011801
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
18021802
let mut has_emitted = false;
1803-
for bound in tcx.bound_explicit_item_bounds(def).transpose_iter() {
1803+
for bound in tcx.explicit_item_bounds(def).transpose_iter() {
18041804
let predicate = bound.map_bound(|&(pred, _)| pred).subst_identity();
18051805

18061806
// We only look at the `DefId`, so it is safe to skip the binder here.

compiler/rustc_privacy/src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ where
269269
// and are visited by shallow visitors.
270270
self.visit_predicates(ty::GenericPredicates {
271271
parent: None,
272-
predicates: tcx.bound_explicit_item_bounds(def_id).skip_binder(),
272+
predicates: tcx.explicit_item_bounds(def_id).skip_binder(),
273273
})?;
274274
}
275275
}
@@ -1784,10 +1784,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
17841784
fn bounds(&mut self) -> &mut Self {
17851785
self.visit_predicates(ty::GenericPredicates {
17861786
parent: None,
1787-
predicates: self
1788-
.tcx
1789-
.bound_explicit_item_bounds(self.item_def_id.to_def_id())
1790-
.skip_binder(),
1787+
predicates: self.tcx.explicit_item_bounds(self.item_def_id).skip_binder(),
17911788
});
17921789
self
17931790
}

compiler/rustc_trait_selection/src/traits/object_safety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn bounds_reference_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SmallVec<[Span
297297
tcx.associated_items(trait_def_id)
298298
.in_definition_order()
299299
.filter(|item| item.kind == ty::AssocKind::Type)
300-
.flat_map(|item| tcx.bound_explicit_item_bounds(item.def_id).transpose_iter())
300+
.flat_map(|item| tcx.explicit_item_bounds(item.def_id).transpose_iter())
301301
.map(|bound| bound.map_bound(|b| *b).subst_identity())
302302
.filter_map(|pred_span| predicate_references_self(tcx, pred_span))
303303
.collect()

compiler/rustc_traits/src/chalk/db.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'tcx> RustIrDatabase<'tcx> {
5050
where
5151
ty::Predicate<'tcx>: LowerInto<'tcx, std::option::Option<T>>,
5252
{
53-
let bounds = self.interner.tcx.bound_explicit_item_bounds(def_id);
53+
let bounds = self.interner.tcx.explicit_item_bounds(def_id);
5454
bounds
5555
.0
5656
.iter()
@@ -506,7 +506,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
506506

507507
let identity_substs = InternalSubsts::identity_for_item(self.interner.tcx, opaque_ty_id.0);
508508

509-
let explicit_item_bounds = self.interner.tcx.bound_explicit_item_bounds(opaque_ty_id.0);
509+
let explicit_item_bounds = self.interner.tcx.explicit_item_bounds(opaque_ty_id.0);
510510
let bounds =
511511
explicit_item_bounds
512512
.0

src/librustdoc/clean/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ fn clean_projection<'tcx>(
421421
if cx.tcx.is_impl_trait_in_trait(ty.skip_binder().def_id) {
422422
let bounds = cx
423423
.tcx
424-
.bound_explicit_item_bounds(ty.skip_binder().def_id)
424+
.explicit_item_bounds(ty.skip_binder().def_id)
425425
.subst_iter_copied(cx.tcx, ty.skip_binder().substs)
426426
.map(|(pred, _)| pred)
427427
.collect::<Vec<_>>();
@@ -1316,7 +1316,7 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
13161316

13171317
if let ty::TraitContainer = assoc_item.container {
13181318
let bounds = tcx
1319-
.bound_explicit_item_bounds(assoc_item.def_id)
1319+
.explicit_item_bounds(assoc_item.def_id)
13201320
.transpose_iter()
13211321
.map(|bound| bound.map_bound(|b| *b).subst_identity());
13221322
let predicates = tcx.explicit_predicates_of(assoc_item.def_id).predicates;
@@ -1847,7 +1847,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
18471847
// by looking up the bounds associated with the def_id.
18481848
let bounds = cx
18491849
.tcx
1850-
.bound_explicit_item_bounds(def_id)
1850+
.explicit_item_bounds(def_id)
18511851
.subst_iter_copied(cx.tcx, substs)
18521852
.map(|(bound, _)| bound)
18531853
.collect::<Vec<_>>();

src/tools/clippy/clippy_lints/src/future_not_send.rs

+1-1
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() {

0 commit comments

Comments
 (0)