@@ -52,7 +52,9 @@ use rustc_type_ir::TyKind::*;
52
52
use rustc_type_ir:: fold:: TypeFoldable ;
53
53
use rustc_type_ir:: lang_items:: TraitSolverLangItem ;
54
54
pub 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
+ } ;
56
58
use tracing:: { debug, instrument} ;
57
59
58
60
use crate :: arena:: Arena ;
@@ -2558,7 +2560,7 @@ impl<'tcx> TyCtxt<'tcx> {
2558
2560
/// Given the def_id of a Trait `trait_def_id` and the name of an associated item `assoc_name`
2559
2561
/// returns true if the `trait_def_id` defines an associated item of name `assoc_name`.
2560
2562
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| {
2562
2564
self . associated_items ( trait_did)
2563
2565
. filter_by_name_unhygienic ( assoc_name. name )
2564
2566
. any ( |item| self . hygienic_eq ( assoc_name, item. ident ( self ) , trait_did) )
@@ -2579,14 +2581,6 @@ impl<'tcx> TyCtxt<'tcx> {
2579
2581
} )
2580
2582
}
2581
2583
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
-
2590
2584
/// Given a closure signature, returns an equivalent fn signature. Detuples
2591
2585
/// and so forth -- so e.g., if we have a sig with `Fn<(u32, i32)>` then
2592
2586
/// you would get a `fn(u32, i32)`.
0 commit comments