@@ -111,30 +111,14 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
111111 }
112112 }
113113
114- pub fn get_auto_trait_impls < F > (
114+ pub fn get_blanket_impls < F > (
115115 & self ,
116116 def_id : DefId ,
117117 def_ctor : & F ,
118118 name : Option < String > ,
119+ generics : & ty:: Generics ,
119120 ) -> Vec < Item >
120121 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-
138122 let ty = self . cx . tcx . type_of ( def_id) ;
139123 let mut traits = Vec :: new ( ) ;
140124 if self . cx . access_levels . borrow ( ) . is_doc_reachable ( def_id) {
@@ -228,6 +212,32 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
228212 } ) ;
229213 }
230214 }
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) ;
231241
232242 debug ! (
233243 "get_auto_trait_impls(def_id={:?}, def_ctor=..., generics={:?}" ,
@@ -252,7 +262,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
252262 def_ctor,
253263 tcx. require_lang_item ( lang_items:: SyncTraitLangItem ) ,
254264 ) . into_iter ( ) )
255- . chain ( traits . into_iter ( ) )
265+ . chain ( self . get_blanket_impls ( def_id , def_ctor , name , & generics ) . into_iter ( ) )
256266 . collect ( ) ;
257267
258268 debug ! (
0 commit comments