@@ -195,6 +195,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
195
195
// We need to recurse into stripped modules to strip things
196
196
// like impl methods but when doing so we must not add any
197
197
// items to the `retained` set.
198
+ debug ! ( "Stripper: recursing into stripped {} {:?}" , i. type_( ) , i. name) ;
198
199
let old = mem:: replace ( & mut self . update_retained , false ) ;
199
200
let ret = self . fold_item_recur ( i) ;
200
201
self . update_retained = old;
@@ -218,6 +219,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
218
219
| clean:: ForeignTypeItem => {
219
220
if i. def_id . is_local ( ) {
220
221
if !self . access_levels . is_exported ( i. def_id ) {
222
+ debug ! ( "Stripper: stripping {} {:?}" , i. type_( ) , i. name) ;
221
223
return None ;
222
224
}
223
225
}
@@ -231,6 +233,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
231
233
232
234
clean:: ModuleItem ( ..) => {
233
235
if i. def_id . is_local ( ) && i. visibility != Some ( clean:: Public ) {
236
+ debug ! ( "Stripper: stripping module {:?}" , i. name) ;
234
237
let old = mem:: replace ( & mut self . update_retained , false ) ;
235
238
let ret = StripItem ( self . fold_item_recur ( i) . unwrap ( ) ) . strip ( ) ;
236
239
self . update_retained = old;
@@ -302,18 +305,22 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
302
305
}
303
306
if let Some ( did) = imp. for_ . def_id ( ) {
304
307
if did. is_local ( ) && !imp. for_ . is_generic ( ) && !self . retained . contains ( & did) {
308
+ debug ! ( "ImplStripper: impl item for stripped type; removing" ) ;
305
309
return None ;
306
310
}
307
311
}
308
312
if let Some ( did) = imp. trait_ . def_id ( ) {
309
313
if did. is_local ( ) && !self . retained . contains ( & did) {
314
+ debug ! ( "ImplStripper: impl item for stripped trait; removing" ) ;
310
315
return None ;
311
316
}
312
317
}
313
318
if let Some ( generics) = imp. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
314
319
for typaram in generics {
315
320
if let Some ( did) = typaram. def_id ( ) {
316
321
if did. is_local ( ) && !self . retained . contains ( & did) {
322
+ debug ! ( "ImplStripper: stripped item in trait's generics; \
323
+ removing impl") ;
317
324
return None ;
318
325
}
319
326
}
0 commit comments