add a bunch of debug prints
This commit is contained in:
parent
50fa16f5b5
commit
a893117f38
3 changed files with 12 additions and 0 deletions
|
@ -527,6 +527,7 @@ pub fn record_extern_trait(cx: &DocContext, did: DefId) {
|
||||||
|
|
||||||
cx.active_extern_traits.borrow_mut().push(did);
|
cx.active_extern_traits.borrow_mut().push(did);
|
||||||
|
|
||||||
|
debug!("record_extern_trait: {:?}", did);
|
||||||
let trait_ = build_external_trait(cx, did);
|
let trait_ = build_external_trait(cx, did);
|
||||||
|
|
||||||
cx.external_traits.borrow_mut().insert(did, trait_);
|
cx.external_traits.borrow_mut().insert(did, trait_);
|
||||||
|
|
|
@ -1223,6 +1223,10 @@ impl<'a> SourceCollector<'a> {
|
||||||
|
|
||||||
impl DocFolder for Cache {
|
impl DocFolder for Cache {
|
||||||
fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
|
fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
|
||||||
|
if item.def_id.is_local() {
|
||||||
|
debug!("folding item \"{:?}\", a {}", item.name, item.type_());
|
||||||
|
}
|
||||||
|
|
||||||
// If this is a stripped module,
|
// If this is a stripped module,
|
||||||
// we don't want it or its children in the search index.
|
// we don't want it or its children in the search index.
|
||||||
let orig_stripped_mod = match item.inner {
|
let orig_stripped_mod = match item.inner {
|
||||||
|
|
|
@ -195,6 +195,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
|
||||||
// We need to recurse into stripped modules to strip things
|
// We need to recurse into stripped modules to strip things
|
||||||
// like impl methods but when doing so we must not add any
|
// like impl methods but when doing so we must not add any
|
||||||
// items to the `retained` set.
|
// items to the `retained` set.
|
||||||
|
debug!("Stripper: recursing into stripped {} {:?}", i.type_(), i.name);
|
||||||
let old = mem::replace(&mut self.update_retained, false);
|
let old = mem::replace(&mut self.update_retained, false);
|
||||||
let ret = self.fold_item_recur(i);
|
let ret = self.fold_item_recur(i);
|
||||||
self.update_retained = old;
|
self.update_retained = old;
|
||||||
|
@ -218,6 +219,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
|
||||||
| clean::ForeignTypeItem => {
|
| clean::ForeignTypeItem => {
|
||||||
if i.def_id.is_local() {
|
if i.def_id.is_local() {
|
||||||
if !self.access_levels.is_exported(i.def_id) {
|
if !self.access_levels.is_exported(i.def_id) {
|
||||||
|
debug!("Stripper: stripping {} {:?}", i.type_(), i.name);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,6 +233,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
|
||||||
|
|
||||||
clean::ModuleItem(..) => {
|
clean::ModuleItem(..) => {
|
||||||
if i.def_id.is_local() && i.visibility != Some(clean::Public) {
|
if i.def_id.is_local() && i.visibility != Some(clean::Public) {
|
||||||
|
debug!("Stripper: stripping module {:?}", i.name);
|
||||||
let old = mem::replace(&mut self.update_retained, false);
|
let old = mem::replace(&mut self.update_retained, false);
|
||||||
let ret = StripItem(self.fold_item_recur(i).unwrap()).strip();
|
let ret = StripItem(self.fold_item_recur(i).unwrap()).strip();
|
||||||
self.update_retained = old;
|
self.update_retained = old;
|
||||||
|
@ -302,11 +305,13 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
|
||||||
}
|
}
|
||||||
if let Some(did) = imp.for_.def_id() {
|
if let Some(did) = imp.for_.def_id() {
|
||||||
if did.is_local() && !imp.for_.is_generic() && !self.retained.contains(&did) {
|
if did.is_local() && !imp.for_.is_generic() && !self.retained.contains(&did) {
|
||||||
|
debug!("ImplStripper: impl item for stripped type; removing");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(did) = imp.trait_.def_id() {
|
if let Some(did) = imp.trait_.def_id() {
|
||||||
if did.is_local() && !self.retained.contains(&did) {
|
if did.is_local() && !self.retained.contains(&did) {
|
||||||
|
debug!("ImplStripper: impl item for stripped trait; removing");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,6 +319,8 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
|
||||||
for typaram in generics {
|
for typaram in generics {
|
||||||
if let Some(did) = typaram.def_id() {
|
if let Some(did) = typaram.def_id() {
|
||||||
if did.is_local() && !self.retained.contains(&did) {
|
if did.is_local() && !self.retained.contains(&did) {
|
||||||
|
debug!("ImplStripper: stripped item in trait's generics; \
|
||||||
|
removing impl");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue