@@ -111,30 +111,14 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
111
111
}
112
112
}
113
113
114
- pub fn get_auto_trait_impls < F > (
114
+ pub fn get_blanket_impls < F > (
115
115
& self ,
116
116
def_id : DefId ,
117
117
def_ctor : & F ,
118
118
name : Option < String > ,
119
+ generics : & ty:: Generics ,
119
120
) -> Vec < Item >
120
121
where F : Fn ( DefId ) -> Def {
121
- if self . cx
122
- . tcx
123
- . get_attrs ( def_id)
124
- . lists ( "doc" )
125
- . has_word ( "hidden" )
126
- {
127
- debug ! (
128
- "get_auto_trait_impls(def_id={:?}, def_ctor=...): item has doc('hidden'), \
129
- aborting",
130
- def_id
131
- ) ;
132
- return Vec :: new ( ) ;
133
- }
134
-
135
- let tcx = self . cx . tcx ;
136
- let generics = self . cx . tcx . generics_of ( def_id) ;
137
-
138
122
let ty = self . cx . tcx . type_of ( def_id) ;
139
123
let mut traits = Vec :: new ( ) ;
140
124
if self . cx . access_levels . borrow ( ) . is_doc_reachable ( def_id) {
@@ -228,6 +212,32 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
228
212
} ) ;
229
213
}
230
214
}
215
+ traits
216
+ }
217
+
218
+ pub fn get_auto_trait_impls < F > (
219
+ & self ,
220
+ def_id : DefId ,
221
+ def_ctor : & F ,
222
+ name : Option < String > ,
223
+ ) -> Vec < Item >
224
+ where F : Fn ( DefId ) -> Def {
225
+ if self . cx
226
+ . tcx
227
+ . get_attrs ( def_id)
228
+ . lists ( "doc" )
229
+ . has_word ( "hidden" )
230
+ {
231
+ debug ! (
232
+ "get_auto_trait_impls(def_id={:?}, def_ctor=...): item has doc('hidden'), \
233
+ aborting",
234
+ def_id
235
+ ) ;
236
+ return Vec :: new ( ) ;
237
+ }
238
+
239
+ let tcx = self . cx . tcx ;
240
+ let generics = self . cx . tcx . generics_of ( def_id) ;
231
241
232
242
debug ! (
233
243
"get_auto_trait_impls(def_id={:?}, def_ctor=..., generics={:?}" ,
@@ -252,7 +262,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
252
262
def_ctor,
253
263
tcx. require_lang_item ( lang_items:: SyncTraitLangItem ) ,
254
264
) . into_iter ( ) )
255
- . chain ( traits . into_iter ( ) )
265
+ . chain ( self . get_blanket_impls ( def_id , def_ctor , name , & generics ) . into_iter ( ) )
256
266
. collect ( ) ;
257
267
258
268
debug ! (
0 commit comments