@@ -52,7 +52,9 @@ use rustc_type_ir::TyKind::*;
5252use rustc_type_ir:: fold:: TypeFoldable ;
5353use rustc_type_ir:: lang_items:: TraitSolverLangItem ;
5454pub use rustc_type_ir:: lift:: Lift ;
55- use rustc_type_ir:: { CollectAndApply , Interner , TypeFlags , WithCachedTypeInfo , search_graph} ;
55+ use rustc_type_ir:: {
56+ CollectAndApply , Interner , TypeFlags , WithCachedTypeInfo , elaborate, search_graph,
57+ } ;
5658use tracing:: { debug, instrument} ;
5759
5860use crate :: arena:: Arena ;
@@ -2558,7 +2560,7 @@ impl<'tcx> TyCtxt<'tcx> {
25582560 /// Given the def_id of a Trait `trait_def_id` and the name of an associated item `assoc_name`
25592561 /// returns true if the `trait_def_id` defines an associated item of name `assoc_name`.
25602562 pub fn trait_may_define_assoc_item ( self , trait_def_id : DefId , assoc_name : Ident ) -> bool {
2561- self . supertrait_def_ids ( trait_def_id) . any ( |trait_did| {
2563+ elaborate :: supertrait_def_ids ( self , trait_def_id) . any ( |trait_did| {
25622564 self . associated_items ( trait_did)
25632565 . filter_by_name_unhygienic ( assoc_name. name )
25642566 . any ( |item| self . hygienic_eq ( assoc_name, item. ident ( self ) , trait_did) )
@@ -2579,14 +2581,6 @@ impl<'tcx> TyCtxt<'tcx> {
25792581 } )
25802582 }
25812583
2582- /// Computes the def-ids of the transitive supertraits of `trait_def_id`. This (intentionally)
2583- /// does not compute the full elaborated super-predicates but just the set of def-ids. It is used
2584- /// to identify which traits may define a given associated type to help avoid cycle errors,
2585- /// and to make size estimates for vtable layout computation.
2586- pub fn supertrait_def_ids ( self , trait_def_id : DefId ) -> impl Iterator < Item = DefId > + ' tcx {
2587- rustc_type_ir:: elaborate:: supertrait_def_ids ( self , trait_def_id)
2588- }
2589-
25902584 /// Given a closure signature, returns an equivalent fn signature. Detuples
25912585 /// and so forth -- so e.g., if we have a sig with `Fn<(u32, i32)>` then
25922586 /// you would get a `fn(u32, i32)`.
0 commit comments