@@ -26,7 +26,6 @@ use rustc_ast::{MetaItemKind, NestedMetaItem};
26
26
use rustc_attr:: { list_contains_name, InlineAttr , InstructionSetAttr , OptimizeAttr } ;
27
27
use rustc_data_structures:: captures:: Captures ;
28
28
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
29
- use rustc_data_structures:: sync:: Lrc ;
30
29
use rustc_errors:: { struct_span_err, Applicability } ;
31
30
use rustc_hir as hir;
32
31
use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
@@ -81,7 +80,6 @@ pub fn provide(providers: &mut Providers) {
81
80
projection_ty_from_predicates,
82
81
explicit_predicates_of,
83
82
super_predicates_of,
84
- super_traits_of,
85
83
super_predicates_that_define_assoc_type,
86
84
trait_explicit_predicates_and_bounds,
87
85
type_param_predicates,
@@ -1116,29 +1114,6 @@ fn super_predicates_that_define_assoc_type(
1116
1114
}
1117
1115
}
1118
1116
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
-
1142
1117
fn trait_def ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> ty:: TraitDef {
1143
1118
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
1144
1119
let item = tcx. hir ( ) . expect_item ( hir_id) ;
0 commit comments