Skip to content

Commit 297b222

Browse files
authored
Rollup merge of rust-lang#110556 - kylematsuda:earlybinder-explicit-item-bounds, r=compiler-errors
Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish rust-lang#105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed rust-lang#110299 and rust-lang#110498 😃)
2 parents 666fee2 + 5a69b5d commit 297b222

File tree

28 files changed

+88
-71
lines changed

28 files changed

+88
-71
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

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

compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
320320
};
321321
let prohibit_opaque = tcx
322322
.explicit_item_bounds(def_id)
323-
.iter()
323+
.subst_identity_iter_copied()
324324
.try_for_each(|(predicate, _)| predicate.visit_with(&mut visitor));
325325

326326
if let Some(ty) = prohibit_opaque.break_value() {

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, associated_items: &[hir::TraitItemRe
360360
tcx,
361361
param_env,
362362
item_def_id,
363-
tcx.explicit_item_bounds(item_def_id).to_vec(),
363+
tcx.explicit_item_bounds(item_def_id)
364+
.subst_identity_iter_copied()
365+
.collect::<Vec<_>>(),
364366
&FxIndexSet::default(),
365367
gat_def_id.def_id,
366368
gat_generics,
@@ -1125,7 +1127,7 @@ fn check_associated_type_bounds(wfcx: &WfCheckingCtxt<'_, '_>, item: ty::AssocIt
11251127
let bounds = wfcx.tcx().explicit_item_bounds(item.def_id);
11261128

11271129
debug!("check_associated_type_bounds: bounds={:?}", bounds);
1128-
let wf_obligations = bounds.iter().flat_map(|&(bound, bound_span)| {
1130+
let wf_obligations = bounds.subst_identity_iter_copied().flat_map(|(bound, bound_span)| {
11291131
let normalized_bound = wfcx.normalize(span, None, bound);
11301132
traits::wf::predicate_obligations(
11311133
wfcx.infcx,
@@ -1588,7 +1590,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
15881590
}
15891591
});
15901592
for (bound, bound_span) in tcx
1591-
.bound_explicit_item_bounds(opaque_ty.def_id)
1593+
.explicit_item_bounds(opaque_ty.def_id)
15921594
.subst_iter_copied(tcx, opaque_ty.substs)
15931595
{
15941596
let bound = self.wfcx.normalize(bound_span, None, bound);

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

+12-10
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,16 +123,18 @@ 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-
let bounds = tcx.mk_predicates_from_iter(util::elaborate(
134-
tcx,
135-
tcx.explicit_item_bounds(def_id).iter().map(|&(bound, _span)| bound),
136-
));
137-
ty::EarlyBinder(bounds)
134+
tcx.explicit_item_bounds(def_id).map_bound(|bounds| {
135+
tcx.mk_predicates_from_iter(util::elaborate(
136+
tcx,
137+
bounds.iter().map(|&(bound, _span)| bound),
138+
))
139+
})
138140
}

compiler/rustc_hir_analysis/src/variance/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +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() {
157-
let pred = pred.map_bound(|(pred, _)| *pred).subst(tcx, id_substs);
156+
for (pred, _) in tcx.explicit_item_bounds(item_def_id).subst_iter_copied(tcx, id_substs) {
158157
debug!(?pred);
159158

160159
// We only ignore opaque type substs if the opaque type is the outermost type.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ 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 &(predicate, _) in fcx.tcx.explicit_item_bounds(def) {
574+
for &(predicate, _) in fcx.tcx.explicit_item_bounds(def).skip_binder() {
575575
// We only look at the `DefId`, so it is safe to skip the binder here.
576576
if let ty::PredicateKind::Clause(ty::Clause::Trait(ref poly_trait_predicate)) =
577577
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 &(pred, pred_span) in cx.tcx.explicit_item_bounds(def_id) {
77+
for (pred, pred_span) in cx.tcx.explicit_item_bounds(def_id).subst_identity_iter_copied() {
7878
// Liberate bound regions in the predicate since we
7979
// don't actually care about lifetimes in this check.
8080
let predicate = cx.tcx.liberate_late_bound_regions(def_id, pred.kind());
@@ -112,7 +112,7 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
112112
// with `impl Send: OtherTrait`.
113113
for (assoc_pred, assoc_pred_span) in cx
114114
.tcx
115-
.bound_explicit_item_bounds(proj.projection_ty.def_id)
115+
.explicit_item_bounds(proj.projection_ty.def_id)
116116
.subst_iter_copied(cx.tcx, &proj.projection_ty.substs)
117117
{
118118
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
@@ -254,7 +254,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
254254
}
255255
ty::Adt(def, _) => is_def_must_use(cx, def.did(), span),
256256
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def, .. }) => {
257-
elaborate(cx.tcx, cx.tcx.explicit_item_bounds(def).iter().cloned())
257+
elaborate(cx.tcx, cx.tcx.explicit_item_bounds(def).subst_identity_iter_copied())
258258
// We only care about self bounds for the impl-trait
259259
.filter_only_self()
260260
.find_map(|(pred, _span)| {

compiler/rustc_metadata/src/rmeta/decoder.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
2323
use rustc_middle::ty::codec::TyDecoder;
2424
use rustc_middle::ty::fast_reject::SimplifiedType;
2525
use rustc_middle::ty::GeneratorDiagnosticData;
26-
use rustc_middle::ty::{self, ParameterizedOverTcx, Ty, TyCtxt, Visibility};
26+
use rustc_middle::ty::{self, ParameterizedOverTcx, Predicate, Ty, TyCtxt, Visibility};
2727
use rustc_serialize::opaque::MemDecoder;
2828
use rustc_serialize::{Decodable, Decoder};
2929
use rustc_session::cstore::{
@@ -857,6 +857,20 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
857857
)
858858
}
859859

860+
fn get_explicit_item_bounds(
861+
self,
862+
index: DefIndex,
863+
tcx: TyCtxt<'tcx>,
864+
) -> ty::EarlyBinder<&'tcx [(Predicate<'tcx>, Span)]> {
865+
let lazy = self.root.tables.explicit_item_bounds.get(self, index);
866+
let output = if lazy.is_default() {
867+
&mut []
868+
} else {
869+
tcx.arena.alloc_from_iter(lazy.decode((self, tcx)))
870+
};
871+
ty::EarlyBinder(&*output)
872+
}
873+
860874
fn get_variant(self, kind: &DefKind, index: DefIndex, parent_did: DefId) -> ty::VariantDef {
861875
let adt_kind = match kind {
862876
DefKind::Variant => ty::AdtKind::Enum,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ 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 => { cdata.get_explicit_item_bounds(def_id.index, tcx) }
207207
explicit_predicates_of => { table }
208208
generics_of => { table }
209209
inferred_outlives_of => { table_defaulted_array }

compiler/rustc_metadata/src/rmeta/encoder.rs

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

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

compiler/rustc_middle/src/query/mod.rs

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

compiler/rustc_middle/src/ty/context.rs

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

1606-
self.explicit_item_bounds(def_id).iter().any(|(predicate, _)| {
1606+
self.explicit_item_bounds(def_id).skip_binder().iter().any(|&(predicate, _)| {
16071607
let ty::PredicateKind::Clause(ty::Clause::Trait(trait_predicate)) = predicate.kind().skip_binder() else {
16081608
return false;
16091609
};

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

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

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

919919
let mut traits = FxIndexMap::default();
920920
let mut fn_traits = FxIndexMap::default();

compiler/rustc_middle/src/ty/subst.rs

+12
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,12 @@ where
612612
) -> SubstIter<'s, 'tcx, I> {
613613
SubstIter { it: self.0.into_iter(), tcx, substs }
614614
}
615+
616+
/// Similar to [`subst_identity`](EarlyBinder::subst_identity),
617+
/// but on an iterator of `TypeFoldable` values.
618+
pub fn subst_identity_iter(self) -> I::IntoIter {
619+
self.0.into_iter()
620+
}
615621
}
616622

617623
pub struct SubstIter<'s, 'tcx, I: IntoIterator> {
@@ -664,6 +670,12 @@ where
664670
) -> SubstIterCopied<'s, 'tcx, I> {
665671
SubstIterCopied { it: self.0.into_iter(), tcx, substs }
666672
}
673+
674+
/// Similar to [`subst_identity`](EarlyBinder::subst_identity),
675+
/// but on an iterator of values that deref to a `TypeFoldable`.
676+
pub fn subst_identity_iter_copied(self) -> impl Iterator<Item = <I::Item as Deref>::Target> {
677+
self.0.into_iter().map(|v| *v)
678+
}
667679
}
668680

669681
pub struct SubstIterCopied<'a, 'tcx, I: IntoIterator> {

compiler/rustc_middle/src/ty/util.rs

-7
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,6 @@ impl<'tcx> TyCtxt<'tcx> {
701701
if visitor.found_recursion { Err(expanded_type) } else { Ok(expanded_type) }
702702
}
703703

704-
pub fn bound_explicit_item_bounds(
705-
self,
706-
def_id: DefId,
707-
) -> ty::EarlyBinder<&'tcx [(ty::Predicate<'tcx>, rustc_span::Span)]> {
708-
ty::EarlyBinder(self.explicit_item_bounds(def_id))
709-
}
710-
711704
/// Returns names of captured upvars for closures and generators.
712705
///
713706
/// 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 &(predicate, _) in tcx.explicit_item_bounds(def) {
1803+
for &(predicate, _) in tcx.explicit_item_bounds(def).skip_binder() {
18041804
// We only look at the `DefId`, so it is safe to skip the binder here.
18051805
if let ty::PredicateKind::Clause(ty::Clause::Trait(ref poly_trait_predicate)) =
18061806
predicate.kind().skip_binder()

compiler/rustc_privacy/src/lib.rs

+2-2
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.explicit_item_bounds(def_id),
272+
predicates: tcx.explicit_item_bounds(def_id).skip_binder(),
273273
})?;
274274
}
275275
}
@@ -1784,7 +1784,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
17841784
fn bounds(&mut self) -> &mut Self {
17851785
self.visit_predicates(ty::GenericPredicates {
17861786
parent: None,
1787-
predicates: self.tcx.explicit_item_bounds(self.item_def_id),
1787+
predicates: self.tcx.explicit_item_bounds(self.item_def_id).skip_binder(),
17881788
});
17891789
self
17901790
}

compiler/rustc_trait_selection/src/traits/object_safety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ 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.explicit_item_bounds(item.def_id))
301-
.filter_map(|pred_span| predicate_references_self(tcx, *pred_span))
300+
.flat_map(|item| tcx.explicit_item_bounds(item.def_id).subst_identity_iter_copied())
301+
.filter_map(|pred_span| predicate_references_self(tcx, pred_span))
302302
.collect()
303303
}
304304

0 commit comments

Comments
 (0)