Skip to content

Commit a893117

Browse files
add a bunch of debug prints
1 parent 50fa16f commit a893117

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ pub fn record_extern_trait(cx: &DocContext, did: DefId) {
527527

528528
cx.active_extern_traits.borrow_mut().push(did);
529529

530+
debug!("record_extern_trait: {:?}", did);
530531
let trait_ = build_external_trait(cx, did);
531532

532533
cx.external_traits.borrow_mut().insert(did, trait_);

src/librustdoc/html/render.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,10 @@ impl<'a> SourceCollector<'a> {
12231223

12241224
impl DocFolder for Cache {
12251225
fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
1226+
if item.def_id.is_local() {
1227+
debug!("folding item \"{:?}\", a {}", item.name, item.type_());
1228+
}
1229+
12261230
// If this is a stripped module,
12271231
// we don't want it or its children in the search index.
12281232
let orig_stripped_mod = match item.inner {

src/librustdoc/passes/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)