Skip to content

Commit e9d5a2f

Browse files
authored
Rollup merge of #127045 - compiler-errors:explicit, r=oli-obk
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated Rename: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
2 parents 1e39eb7 + 1160eec commit e9d5a2f

File tree

22 files changed

+71
-97
lines changed

22 files changed

+71
-97
lines changed

compiler/rustc_hir_analysis/src/collect.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ pub fn provide(providers: &mut Providers) {
7070
predicates_of: predicates_of::predicates_of,
7171
predicates_defined_on,
7272
explicit_predicates_of: predicates_of::explicit_predicates_of,
73-
super_predicates_of: predicates_of::super_predicates_of,
74-
implied_predicates_of: predicates_of::implied_predicates_of,
75-
super_predicates_that_define_assoc_item:
76-
predicates_of::super_predicates_that_define_assoc_item,
73+
explicit_super_predicates_of: predicates_of::explicit_super_predicates_of,
74+
explicit_implied_predicates_of: predicates_of::explicit_implied_predicates_of,
75+
explicit_supertraits_containing_assoc_item:
76+
predicates_of::explicit_supertraits_containing_assoc_item,
7777
trait_explicit_predicates_and_bounds: predicates_of::trait_explicit_predicates_and_bounds,
7878
type_param_predicates: predicates_of::type_param_predicates,
7979
trait_def,
@@ -691,14 +691,14 @@ fn lower_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
691691
hir::ItemKind::Trait(..) => {
692692
tcx.ensure().generics_of(def_id);
693693
tcx.ensure().trait_def(def_id);
694-
tcx.at(it.span).super_predicates_of(def_id);
694+
tcx.at(it.span).explicit_super_predicates_of(def_id);
695695
tcx.ensure().predicates_of(def_id);
696696
tcx.ensure().associated_items(def_id);
697697
}
698698
hir::ItemKind::TraitAlias(..) => {
699699
tcx.ensure().generics_of(def_id);
700-
tcx.at(it.span).implied_predicates_of(def_id);
701-
tcx.at(it.span).super_predicates_of(def_id);
700+
tcx.at(it.span).explicit_implied_predicates_of(def_id);
701+
tcx.at(it.span).explicit_super_predicates_of(def_id);
702702
tcx.ensure().predicates_of(def_id);
703703
}
704704
hir::ItemKind::Struct(struct_def, _) | hir::ItemKind::Union(struct_def, _) => {

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -519,21 +519,21 @@ pub(super) fn explicit_predicates_of<'tcx>(
519519
/// Ensures that the super-predicates of the trait with a `DefId`
520520
/// of `trait_def_id` are lowered and stored. This also ensures that
521521
/// the transitive super-predicates are lowered.
522-
pub(super) fn super_predicates_of(
522+
pub(super) fn explicit_super_predicates_of(
523523
tcx: TyCtxt<'_>,
524524
trait_def_id: LocalDefId,
525525
) -> ty::GenericPredicates<'_> {
526526
implied_predicates_with_filter(tcx, trait_def_id.to_def_id(), PredicateFilter::SelfOnly)
527527
}
528528

529-
pub(super) fn super_predicates_that_define_assoc_item(
529+
pub(super) fn explicit_supertraits_containing_assoc_item(
530530
tcx: TyCtxt<'_>,
531531
(trait_def_id, assoc_name): (DefId, Ident),
532532
) -> ty::GenericPredicates<'_> {
533533
implied_predicates_with_filter(tcx, trait_def_id, PredicateFilter::SelfThatDefines(assoc_name))
534534
}
535535

536-
pub(super) fn implied_predicates_of(
536+
pub(super) fn explicit_implied_predicates_of(
537537
tcx: TyCtxt<'_>,
538538
trait_def_id: LocalDefId,
539539
) -> ty::GenericPredicates<'_> {
@@ -560,7 +560,7 @@ pub(super) fn implied_predicates_with_filter(
560560
// if `assoc_name` is None, then the query should've been redirected to an
561561
// external provider
562562
assert!(matches!(filter, PredicateFilter::SelfThatDefines(_)));
563-
return tcx.super_predicates_of(trait_def_id);
563+
return tcx.explicit_super_predicates_of(trait_def_id);
564564
};
565565

566566
let Node::Item(item) = tcx.hir_node_by_def_id(trait_def_id) else {
@@ -601,7 +601,7 @@ pub(super) fn implied_predicates_with_filter(
601601
if let ty::ClauseKind::Trait(bound) = pred.kind().skip_binder()
602602
&& bound.polarity == ty::PredicatePolarity::Positive
603603
{
604-
tcx.at(span).super_predicates_of(bound.def_id());
604+
tcx.at(span).explicit_super_predicates_of(bound.def_id());
605605
}
606606
}
607607
}
@@ -611,7 +611,7 @@ pub(super) fn implied_predicates_with_filter(
611611
if let ty::ClauseKind::Trait(bound) = pred.kind().skip_binder()
612612
&& bound.polarity == ty::PredicatePolarity::Positive
613613
{
614-
tcx.at(span).implied_predicates_of(bound.def_id());
614+
tcx.at(span).explicit_implied_predicates_of(bound.def_id());
615615
}
616616
}
617617
}

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
17601760
if let Some(assoc_item) = trait_defines_associated_item_named(def_id) {
17611761
break Some((bound_vars.into_iter().collect(), assoc_item));
17621762
}
1763-
let predicates = tcx.super_predicates_that_define_assoc_item((def_id, assoc_name));
1763+
let predicates = tcx.explicit_supertraits_containing_assoc_item((def_id, assoc_name));
17641764
let obligations = predicates.predicates.iter().filter_map(|&(pred, _)| {
17651765
let bound_predicate = pred.kind();
17661766
match bound_predicate.skip_binder() {

compiler/rustc_infer/src/traits/util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
275275
}
276276
// Get predicates implied by the trait, or only super predicates if we only care about self predicates.
277277
let predicates = match self.mode {
278-
Filter::All => tcx.implied_predicates_of(data.def_id()),
279-
Filter::OnlySelf => tcx.super_predicates_of(data.def_id()),
278+
Filter::All => tcx.explicit_implied_predicates_of(data.def_id()),
279+
Filter::OnlySelf => tcx.explicit_super_predicates_of(data.def_id()),
280280
Filter::OnlySelfThatDefines(ident) => {
281-
tcx.super_predicates_that_define_assoc_item((data.def_id(), ident))
281+
tcx.explicit_supertraits_containing_assoc_item((data.def_id(), ident))
282282
}
283283
};
284284

@@ -420,7 +420,7 @@ pub fn transitive_bounds<'tcx>(
420420

421421
/// A specialized variant of `elaborate` that only elaborates trait references that may
422422
/// define the given associated item with the name `assoc_name`. It uses the
423-
/// `super_predicates_that_define_assoc_item` query to avoid enumerating super-predicates that
423+
/// `explicit_supertraits_containing_assoc_item` query to avoid enumerating super-predicates that
424424
/// aren't related to `assoc_item`. This is used when resolving types like `Self::Item` or
425425
/// `T::Item` and helps to avoid cycle errors (see e.g. #35237).
426426
pub fn transitive_bounds_that_define_assoc_item<'tcx>(

compiler/rustc_lint/src/multiple_supertrait_upcastable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleSupertraitUpcastable {
4545
{
4646
let direct_super_traits_iter = cx
4747
.tcx
48-
.super_predicates_of(def_id)
48+
.explicit_super_predicates_of(def_id)
4949
.predicates
5050
.into_iter()
5151
.filter_map(|(pred, _)| pred.as_trait_clause());

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ provide! { tcx, def_id, other, cdata,
211211
explicit_predicates_of => { table }
212212
generics_of => { table }
213213
inferred_outlives_of => { table_defaulted_array }
214-
super_predicates_of => { table }
215-
implied_predicates_of => { table }
214+
explicit_super_predicates_of => { table }
215+
explicit_implied_predicates_of => { table }
216216
type_of => { table }
217217
type_alias_is_lazy => { cdata.root.tables.type_alias_is_lazy.get(cdata, def_id.index) }
218218
variances_of => { table }

compiler/rustc_metadata/src/rmeta/encoder.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1431,17 +1431,17 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14311431
}
14321432
if let DefKind::Trait = def_kind {
14331433
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
1434-
record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id));
1435-
record!(self.tables.implied_predicates_of[def_id] <- self.tcx.implied_predicates_of(def_id));
1434+
record!(self.tables.explicit_super_predicates_of[def_id] <- self.tcx.explicit_super_predicates_of(def_id));
1435+
record!(self.tables.explicit_implied_predicates_of[def_id] <- self.tcx.explicit_implied_predicates_of(def_id));
14361436

14371437
let module_children = self.tcx.module_children_local(local_id);
14381438
record_array!(self.tables.module_children_non_reexports[def_id] <-
14391439
module_children.iter().map(|child| child.res.def_id().index));
14401440
}
14411441
if let DefKind::TraitAlias = def_kind {
14421442
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
1443-
record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id));
1444-
record!(self.tables.implied_predicates_of[def_id] <- self.tcx.implied_predicates_of(def_id));
1443+
record!(self.tables.explicit_super_predicates_of[def_id] <- self.tcx.explicit_super_predicates_of(def_id));
1444+
record!(self.tables.explicit_implied_predicates_of[def_id] <- self.tcx.explicit_implied_predicates_of(def_id));
14451445
}
14461446
if let DefKind::Trait | DefKind::Impl { .. } = def_kind {
14471447
let associated_item_def_ids = self.tcx.associated_item_def_ids(def_id);

compiler/rustc_metadata/src/rmeta/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ define_tables! {
416416
lookup_deprecation_entry: Table<DefIndex, LazyValue<attr::Deprecation>>,
417417
explicit_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
418418
generics_of: Table<DefIndex, LazyValue<ty::Generics>>,
419-
super_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
419+
explicit_super_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
420420
// As an optimization, we only store this for trait aliases,
421-
// since it's identical to super_predicates_of for traits.
422-
implied_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
421+
// since it's identical to explicit_super_predicates_of for traits.
422+
explicit_implied_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
423423
type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>,
424424
variances_of: Table<DefIndex, LazyArray<ty::Variance>>,
425425
fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>,

compiler/rustc_middle/src/query/mod.rs

+19-13
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,9 @@ rustc_queries! {
646646
}
647647

648648
/// Returns the predicates written explicitly by the user.
649+
///
650+
/// You should probably use `predicates_of` unless you're looking for
651+
/// predicates with explicit spans for diagnostics purposes.
649652
query explicit_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
650653
desc { |tcx| "computing explicit predicates of `{}`", tcx.def_path_str(key) }
651654
cache_on_disk_if { key.is_local() }
@@ -662,29 +665,32 @@ rustc_queries! {
662665
feedable
663666
}
664667

665-
/// Maps from the `DefId` of a trait to the list of
666-
/// super-predicates. This is a subset of the full list of
667-
/// predicates. We store these in a separate map because we must
668-
/// evaluate them even during type conversion, often before the
669-
/// full predicates are available (note that supertraits have
670-
/// additional acyclicity requirements).
671-
query super_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
668+
/// Maps from the `DefId` of a trait to the list of super-predicates of the trait,
669+
/// *before* elaboration (so it doesn't contain transitive super-predicates). This
670+
/// is a subset of the full list of predicates. We store these in a separate map
671+
/// because we must evaluate them even during type conversion, often before the full
672+
/// predicates are available (note that super-predicates must not be cyclic).
673+
query explicit_super_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
672674
desc { |tcx| "computing the super predicates of `{}`", tcx.def_path_str(key) }
673675
cache_on_disk_if { key.is_local() }
674676
separate_provide_extern
675677
}
676678

677-
query implied_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
679+
/// The predicates of the trait that are implied during elaboration. This is a
680+
/// superset of the super-predicates of the trait, but a subset of the predicates
681+
/// of the trait. For regular traits, this includes all super-predicates and their
682+
/// associated type bounds. For trait aliases, currently, this includes all of the
683+
/// predicates of the trait alias.
684+
query explicit_implied_predicates_of(key: DefId) -> ty::GenericPredicates<'tcx> {
678685
desc { |tcx| "computing the implied predicates of `{}`", tcx.def_path_str(key) }
679686
cache_on_disk_if { key.is_local() }
680687
separate_provide_extern
681688
}
682689

683-
/// The `Option<Ident>` is the name of an associated type. If it is `None`, then this query
684-
/// returns the full set of predicates. If `Some<Ident>`, then the query returns only the
685-
/// subset of super-predicates that reference traits that define the given associated type.
686-
/// This is used to avoid cycles in resolving types like `T::Item`.
687-
query super_predicates_that_define_assoc_item(key: (DefId, rustc_span::symbol::Ident)) -> ty::GenericPredicates<'tcx> {
690+
/// The Ident is the name of an associated type.The query returns only the subset
691+
/// of supertraits that define the given associated type. This is used to avoid
692+
/// cycles in resolving type-dependent associated item paths like `T::Item`.
693+
query explicit_supertraits_containing_assoc_item(key: (DefId, rustc_span::symbol::Ident)) -> ty::GenericPredicates<'tcx> {
688694
desc { |tcx| "computing the super traits of `{}` with associated type name `{}`",
689695
tcx.def_path_str(key.0),
690696
key.1

compiler/rustc_middle/src/traits/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct Elaborator<'tcx> {
3535
impl<'tcx> Elaborator<'tcx> {
3636
fn elaborate(&mut self, trait_ref: PolyTraitRef<'tcx>) {
3737
let super_predicates =
38-
self.tcx.super_predicates_of(trait_ref.def_id()).predicates.iter().filter_map(
38+
self.tcx.explicit_super_predicates_of(trait_ref.def_id()).predicates.iter().filter_map(
3939
|&(pred, _)| {
4040
let clause = pred.instantiate_supertrait(self.tcx, trait_ref);
4141
self.visited.insert(clause).then_some(clause)

compiler/rustc_middle/src/ty/context.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,15 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
342342
)
343343
}
344344

345-
fn super_predicates_of(
345+
fn explicit_super_predicates_of(
346346
self,
347347
def_id: DefId,
348348
) -> ty::EarlyBinder<'tcx, impl IntoIterator<Item = ty::Clause<'tcx>>> {
349349
ty::EarlyBinder::bind(
350-
self.super_predicates_of(def_id).instantiate_identity(self).predicates.into_iter(),
350+
self.explicit_super_predicates_of(def_id)
351+
.instantiate_identity(self)
352+
.predicates
353+
.into_iter(),
351354
)
352355
}
353356

@@ -2440,7 +2443,7 @@ impl<'tcx> TyCtxt<'tcx> {
24402443
/// Given the def_id of a Trait `trait_def_id` and the name of an associated item `assoc_name`
24412444
/// returns true if the `trait_def_id` defines an associated item of name `assoc_name`.
24422445
pub fn trait_may_define_assoc_item(self, trait_def_id: DefId, assoc_name: Ident) -> bool {
2443-
self.super_traits_of(trait_def_id).any(|trait_did| {
2446+
self.supertrait_def_ids(trait_def_id).any(|trait_did| {
24442447
self.associated_items(trait_did)
24452448
.filter_by_name_unhygienic(assoc_name.name)
24462449
.any(|item| self.hygienic_eq(assoc_name, item.ident(self), trait_did))
@@ -2463,17 +2466,17 @@ impl<'tcx> TyCtxt<'tcx> {
24632466

24642467
/// Computes the def-ids of the transitive supertraits of `trait_def_id`. This (intentionally)
24652468
/// does not compute the full elaborated super-predicates but just the set of def-ids. It is used
2466-
/// to identify which traits may define a given associated type to help avoid cycle errors.
2467-
/// Returns a `DefId` iterator.
2468-
fn super_traits_of(self, trait_def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
2469+
/// to identify which traits may define a given associated type to help avoid cycle errors,
2470+
/// and to make size estimates for vtable layout computation.
2471+
pub fn supertrait_def_ids(self, trait_def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
24692472
let mut set = FxHashSet::default();
24702473
let mut stack = vec![trait_def_id];
24712474

24722475
set.insert(trait_def_id);
24732476

24742477
iter::from_fn(move || -> Option<DefId> {
24752478
let trait_did = stack.pop()?;
2476-
let generic_predicates = self.super_predicates_of(trait_did);
2479+
let generic_predicates = self.explicit_super_predicates_of(trait_did);
24772480

24782481
for (predicate, _) in generic_predicates.predicates {
24792482
if let ty::ClauseKind::Trait(data) = predicate.kind().skip_binder() {

compiler/rustc_middle/src/ty/vtable.rs

-35
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use std::fmt;
33
use crate::mir::interpret::{alloc_range, AllocId, Allocation, Pointer, Scalar};
44
use crate::ty::{self, Instance, PolyTraitRef, Ty, TyCtxt};
55
use rustc_ast::Mutability;
6-
use rustc_data_structures::fx::FxHashSet;
7-
use rustc_hir::def_id::DefId;
86
use rustc_macros::HashStable;
97

108
#[derive(Clone, Copy, PartialEq, HashStable)]
@@ -42,45 +40,12 @@ impl<'tcx> fmt::Debug for VtblEntry<'tcx> {
4240
impl<'tcx> TyCtxt<'tcx> {
4341
pub const COMMON_VTABLE_ENTRIES: &'tcx [VtblEntry<'tcx>] =
4442
&[VtblEntry::MetadataDropInPlace, VtblEntry::MetadataSize, VtblEntry::MetadataAlign];
45-
46-
pub fn supertrait_def_ids(self, trait_def_id: DefId) -> SupertraitDefIds<'tcx> {
47-
SupertraitDefIds {
48-
tcx: self,
49-
stack: vec![trait_def_id],
50-
visited: Some(trait_def_id).into_iter().collect(),
51-
}
52-
}
5343
}
5444

5545
pub const COMMON_VTABLE_ENTRIES_DROPINPLACE: usize = 0;
5646
pub const COMMON_VTABLE_ENTRIES_SIZE: usize = 1;
5747
pub const COMMON_VTABLE_ENTRIES_ALIGN: usize = 2;
5848

59-
pub struct SupertraitDefIds<'tcx> {
60-
tcx: TyCtxt<'tcx>,
61-
stack: Vec<DefId>,
62-
visited: FxHashSet<DefId>,
63-
}
64-
65-
impl Iterator for SupertraitDefIds<'_> {
66-
type Item = DefId;
67-
68-
fn next(&mut self) -> Option<DefId> {
69-
let def_id = self.stack.pop()?;
70-
let predicates = self.tcx.super_predicates_of(def_id);
71-
let visited = &mut self.visited;
72-
self.stack.extend(
73-
predicates
74-
.predicates
75-
.iter()
76-
.filter_map(|(pred, _)| pred.as_trait_clause())
77-
.map(|trait_ref| trait_ref.def_id())
78-
.filter(|&super_def_id| visited.insert(super_def_id)),
79-
);
80-
Some(def_id)
81-
}
82-
}
83-
8449
// Note that we don't have access to a self type here, this has to be purely based on the trait (and
8550
// supertrait) definitions. That means we can't call into the same vtable_entries code since that
8651
// returns a specific instantiation (e.g., with Vacant slots when bounds aren't satisfied). The goal

compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,9 @@ where
668668
{
669669
let cx = ecx.cx();
670670
let mut requirements = vec![];
671-
requirements
672-
.extend(cx.super_predicates_of(trait_ref.def_id).iter_instantiated(cx, trait_ref.args));
671+
requirements.extend(
672+
cx.explicit_super_predicates_of(trait_ref.def_id).iter_instantiated(cx, trait_ref.args),
673+
);
673674

674675
// FIXME(associated_const_equality): Also add associated consts to
675676
// the requirements here.

compiler/rustc_trait_selection/src/traits/object_safety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn predicates_reference_self(
187187
) -> SmallVec<[Span; 1]> {
188188
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, trait_def_id));
189189
let predicates = if supertraits_only {
190-
tcx.super_predicates_of(trait_def_id)
190+
tcx.explicit_super_predicates_of(trait_def_id)
191191
} else {
192192
tcx.predicates_of(trait_def_id)
193193
};
@@ -256,7 +256,7 @@ fn super_predicates_have_non_lifetime_binders(
256256
if !tcx.features().non_lifetime_binders {
257257
return SmallVec::new();
258258
}
259-
tcx.super_predicates_of(trait_def_id)
259+
tcx.explicit_super_predicates_of(trait_def_id)
260260
.predicates
261261
.iter()
262262
.filter_map(|(pred, span)| pred.has_non_region_bound_vars().then_some(*span))

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
574574
// Check supertraits hold. This is so that their associated type bounds
575575
// will be checked in the code below.
576576
for super_trait in tcx
577-
.super_predicates_of(trait_predicate.def_id())
577+
.explicit_super_predicates_of(trait_predicate.def_id())
578578
.instantiate(tcx, trait_predicate.trait_ref.args)
579579
.predicates
580580
.into_iter()

0 commit comments

Comments
 (0)