File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,12 @@ fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> clean::Item {
250
250
let associated_trait = csearch:: get_impl_trait ( tcx, did) ;
251
251
let attrs = load_attrs ( tcx, did) ;
252
252
let ty = ty:: lookup_item_type ( tcx, did) ;
253
- let methods = csearch:: get_impl_methods ( & tcx. sess . cstore , did) . iter ( ) . map ( |did| {
253
+ let methods = csearch:: get_impl_methods ( & tcx. sess . cstore ,
254
+ did) . iter ( ) . filter_map ( |did| {
255
+ let method = ty:: method ( tcx, * did) ;
256
+ if method. vis != ast:: Public && associated_trait. is_none ( ) {
257
+ return None
258
+ }
254
259
let mut item = match ty:: method ( tcx, * did) . clean ( ) {
255
260
clean:: Provided ( item) => item,
256
261
clean:: Required ( item) => item,
@@ -268,7 +273,7 @@ fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> clean::Item {
268
273
}
269
274
_ => fail ! ( "not a tymethod" ) ,
270
275
} ;
271
- item
276
+ Some ( item)
272
277
} ) . collect ( ) ;
273
278
clean:: Item {
274
279
inner : clean:: ImplItem ( clean:: Impl {
You can’t perform that action at this time.
0 commit comments