File tree 2 files changed +2
-17
lines changed
compiler/rustc_middle/src/ty
src/tools/clippy/clippy_lints/src
2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -129,21 +129,6 @@ impl<'tcx> TraitDef {
129
129
}
130
130
131
131
impl < ' 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
-
147
132
/// Iterate over every impl that could possibly match the self type `self_ty`.
148
133
///
149
134
/// `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 {
97
97
{
98
98
if self . impling_types . is_none ( ) {
99
99
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) {
101
101
let ty = cx. tcx . type_of ( d) . instantiate_identity ( ) ;
102
102
if let Some ( ty_def) = ty. ty_adt_def ( ) {
103
103
if let Some ( local_def_id) = ty_def. did ( ) . as_local ( ) {
104
104
impls. insert ( cx. tcx . local_def_id_to_hir_id ( local_def_id) ) ;
105
105
}
106
106
}
107
- } ) ;
107
+ }
108
108
self . impling_types = Some ( impls) ;
109
109
}
110
110
You can’t perform that action at this time.
0 commit comments