@@ -195,6 +195,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
195195 // We need to recurse into stripped modules to strip things
196196 // like impl methods but when doing so we must not add any
197197 // items to the `retained` set.
198+ debug ! ( "Stripper: recursing into stripped {} {:?}" , i. type_( ) , i. name) ;
198199 let old = mem:: replace ( & mut self . update_retained , false ) ;
199200 let ret = self . fold_item_recur ( i) ;
200201 self . update_retained = old;
@@ -218,6 +219,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
218219 | clean:: ForeignTypeItem => {
219220 if i. def_id . is_local ( ) {
220221 if !self . access_levels . is_exported ( i. def_id ) {
222+ debug ! ( "Stripper: stripping {} {:?}" , i. type_( ) , i. name) ;
221223 return None ;
222224 }
223225 }
@@ -231,6 +233,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
231233
232234 clean:: ModuleItem ( ..) => {
233235 if i. def_id . is_local ( ) && i. visibility != Some ( clean:: Public ) {
236+ debug ! ( "Stripper: stripping module {:?}" , i. name) ;
234237 let old = mem:: replace ( & mut self . update_retained , false ) ;
235238 let ret = StripItem ( self . fold_item_recur ( i) . unwrap ( ) ) . strip ( ) ;
236239 self . update_retained = old;
@@ -302,18 +305,22 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
302305 }
303306 if let Some ( did) = imp. for_ . def_id ( ) {
304307 if did. is_local ( ) && !imp. for_ . is_generic ( ) && !self . retained . contains ( & did) {
308+ debug ! ( "ImplStripper: impl item for stripped type; removing" ) ;
305309 return None ;
306310 }
307311 }
308312 if let Some ( did) = imp. trait_ . def_id ( ) {
309313 if did. is_local ( ) && !self . retained . contains ( & did) {
314+ debug ! ( "ImplStripper: impl item for stripped trait; removing" ) ;
310315 return None ;
311316 }
312317 }
313318 if let Some ( generics) = imp. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
314319 for typaram in generics {
315320 if let Some ( did) = typaram. def_id ( ) {
316321 if did. is_local ( ) && !self . retained . contains ( & did) {
322+ debug ! ( "ImplStripper: stripped item in trait's generics; \
323+ removing impl") ;
317324 return None ;
318325 }
319326 }
0 commit comments