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 {
105105
106106impl < ' tcx > TyCtxt < ' tcx > {
107107 /// `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) {
112110 f ( impl_def_id) ;
113111 }
114-
115- for v in impls. non_blanket_impls . values ( ) {
116- for & impl_def_id in v {
117- f ( impl_def_id) ;
118- }
119- }
120112 }
121113
122114 /// Iterate over every impl that could possibly match the self type `self_ty`.
@@ -190,9 +182,7 @@ impl<'tcx> TyCtxt<'tcx> {
190182 }
191183 }
192184 } 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) ;
196186 }
197187 }
198188
You can’t perform that action at this time.
0 commit comments