File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
compiler/rustc_middle/src/ty
src/tools/clippy/clippy_lints/src Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -129,21 +129,6 @@ impl<'tcx> TraitDef {
129129}
130130
131131impl < ' tcx > TyCtxt < ' tcx > {
132- /// `trait_def_id` MUST BE the `DefId` of a trait.
133- pub fn for_each_impl < F : FnMut ( DefId ) > ( self , trait_def_id : DefId , mut f : F ) {
134- let impls = self . trait_impls_of ( trait_def_id) ;
135-
136- for & impl_def_id in impls. blanket_impls . iter ( ) {
137- f ( impl_def_id) ;
138- }
139-
140- for v in impls. non_blanket_impls . values ( ) {
141- for & impl_def_id in v {
142- f ( impl_def_id) ;
143- }
144- }
145- }
146-
147132 /// Iterate over every impl that could possibly match the self type `self_ty`.
148133 ///
149134 /// `trait_def_id` MUST BE the `DefId` of a trait.
Original file line number Diff line number Diff line change @@ -97,14 +97,14 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
9797 {
9898 if self . impling_types . is_none ( ) {
9999 let mut impls = HirIdSet :: default ( ) ;
100- cx. tcx . for_each_impl ( default_trait_id, |d| {
100+ for & d in cx. tcx . local_trait_impls ( default_trait_id) {
101101 let ty = cx. tcx . type_of ( d) . instantiate_identity ( ) ;
102102 if let Some ( ty_def) = ty. ty_adt_def ( ) {
103103 if let Some ( local_def_id) = ty_def. did ( ) . as_local ( ) {
104104 impls. insert ( cx. tcx . local_def_id_to_hir_id ( local_def_id) ) ;
105105 }
106106 }
107- } ) ;
107+ }
108108 self . impling_types = Some ( impls) ;
109109 }
110110
You can’t perform that action at this time.
0 commit comments