File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,10 @@ impl<'tcx> TraitDef {
105
105
106
106
impl < ' tcx > TyCtxt < ' tcx > {
107
107
/// `trait_def_id` MUST BE the `DefId` of a trait.
108
- pub fn for_each_impl < F : FnMut ( DefId ) > ( self , trait_def_id : DefId , mut f : F ) {
109
- let impls = self . trait_impls_of ( trait_def_id) ;
110
-
111
- for & impl_def_id in impls. blanket_impls . iter ( ) {
108
+ pub fn for_each_impl ( self , trait_def_id : DefId , mut f : impl FnMut ( DefId ) ) {
109
+ for impl_def_id in self . all_impls ( trait_def_id) {
112
110
f ( impl_def_id) ;
113
111
}
114
-
115
- for v in impls. non_blanket_impls . values ( ) {
116
- for & impl_def_id in v {
117
- f ( impl_def_id) ;
118
- }
119
- }
120
112
}
121
113
122
114
/// Iterate over every impl that could possibly match the self type `self_ty`.
@@ -190,9 +182,7 @@ impl<'tcx> TyCtxt<'tcx> {
190
182
}
191
183
}
192
184
} else {
193
- for impl_def_id in self . all_impls ( trait_def_id) {
194
- f ( impl_def_id) ;
195
- }
185
+ self . for_each_impl ( trait_def_id, f) ;
196
186
}
197
187
}
198
188
You can’t perform that action at this time.
0 commit comments