Skip to content

Commit

Permalink
rustdoc,metadata: Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Aug 30, 2020
1 parent 868927f commit a1c71a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ impl<'a> CrateLoader<'a> {
let mut ret = None;
self.cstore.iter_crate_data(|cnum, data| {
if data.name() != name {
tracing::trace!("{} did not match {}", data.name(), name);
return;
}

Expand All @@ -230,7 +231,10 @@ impl<'a> CrateLoader<'a> {
ret = Some(cnum);
return;
}
Some(..) => return,
Some(hash) => {
debug!("actual hash {} did not match expected {}", hash, data.hash());
return;
}
None => {}
}

Expand Down Expand Up @@ -273,6 +277,11 @@ impl<'a> CrateLoader<'a> {
.1;
if kind.matches(prev_kind) {
ret = Some(cnum);
} else {
debug!(
"failed to load existing crate {}; kind {:?} did not match prev_kind {:?}",
name, kind, prev_kind
);
}
});
ret
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ pub fn run_core(
resolver.borrow_mut().access(|resolver| {
sess.time("load_extern_crates", || {
for extern_name in &extern_names {
debug!("loading extern crate {}", extern_name);
resolver
.resolve_str_path_error(
DUMMY_SP,
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
return Some(res.map_id(|_| panic!("unexpected id")));
}
if let Some(module_id) = parent_id {
debug!("resolving {} as a macro in the module {:?}", path_str, module_id);
if let Ok((_, res)) =
resolver.resolve_str_path_error(DUMMY_SP, path_str, MacroNS, module_id)
{
Expand Down

0 comments on commit a1c71a1

Please sign in to comment.