@@ -26,7 +26,6 @@ use rustc_ast::{MetaItemKind, NestedMetaItem};
2626use rustc_attr:: { list_contains_name, InlineAttr , InstructionSetAttr , OptimizeAttr } ;
2727use rustc_data_structures:: captures:: Captures ;
2828use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
29- use rustc_data_structures:: sync:: Lrc ;
3029use rustc_errors:: { struct_span_err, Applicability } ;
3130use rustc_hir as hir;
3231use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
@@ -81,7 +80,6 @@ pub fn provide(providers: &mut Providers) {
8180 projection_ty_from_predicates,
8281 explicit_predicates_of,
8382 super_predicates_of,
84- super_traits_of,
8583 super_predicates_that_define_assoc_type,
8684 trait_explicit_predicates_and_bounds,
8785 type_param_predicates,
@@ -1116,29 +1114,6 @@ fn super_predicates_that_define_assoc_type(
11161114 }
11171115}
11181116
1119- /// Computes the def-ids of the transitive super-traits of `trait_def_id`. This (intentionally)
1120- /// does not compute the full elaborated super-predicates but just the set of def-ids. It is used
1121- /// to identify which traits may define a given associated type to help avoid cycle errors.
1122- /// Returns `Lrc<FxHashSet<DefId>>` so that cloning is cheaper.
1123- fn super_traits_of ( tcx : TyCtxt < ' _ > , trait_def_id : DefId ) -> Lrc < FxHashSet < DefId > > {
1124- let mut set = FxHashSet :: default ( ) ;
1125- let mut stack = vec ! [ trait_def_id] ;
1126- while let Some ( trait_did) = stack. pop ( ) {
1127- if !set. insert ( trait_did) {
1128- continue ;
1129- }
1130-
1131- let generic_predicates = tcx. super_predicates_of ( trait_did) ;
1132- for ( predicate, _) in generic_predicates. predicates {
1133- if let ty:: PredicateAtom :: Trait ( data, _) = predicate. skip_binders ( ) {
1134- stack. push ( data. def_id ( ) ) ;
1135- }
1136- }
1137- }
1138-
1139- Lrc :: new ( set)
1140- }
1141-
11421117fn trait_def ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> ty:: TraitDef {
11431118 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
11441119 let item = tcx. hir ( ) . expect_item ( hir_id) ;
0 commit comments