@@ -646,6 +646,9 @@ rustc_queries! {
646
646
}
647
647
648
648
/// 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.
649
652
query explicit_predicates_of( key: DefId ) -> ty:: GenericPredicates <' tcx> {
650
653
desc { |tcx| "computing explicit predicates of `{}`" , tcx. def_path_str( key) }
651
654
cache_on_disk_if { key. is_local( ) }
@@ -662,29 +665,32 @@ rustc_queries! {
662
665
feedable
663
666
}
664
667
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> {
672
674
desc { |tcx| "computing the super predicates of `{}`" , tcx. def_path_str( key) }
673
675
cache_on_disk_if { key. is_local( ) }
674
676
separate_provide_extern
675
677
}
676
678
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> {
678
685
desc { |tcx| "computing the implied predicates of `{}`" , tcx. def_path_str( key) }
679
686
cache_on_disk_if { key. is_local( ) }
680
687
separate_provide_extern
681
688
}
682
689
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> {
688
694
desc { |tcx| "computing the super traits of `{}` with associated type name `{}`" ,
689
695
tcx. def_path_str( key. 0 ) ,
690
696
key. 1
0 commit comments