Skip to content

Commit

Permalink
Print more crate details in -Zls
Browse files Browse the repository at this point in the history
Useful for debugging crate hash and resolution issues.
  • Loading branch information
jsgf committed Jun 22, 2021
1 parent 406d4a9 commit cef3ab7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions compiler/rustc_metadata/src/rmeta/decoder.rs
Expand Up @@ -601,10 +601,23 @@ impl MetadataBlob {
}

crate fn list_crate_metadata(&self, out: &mut dyn io::Write) -> io::Result<()> {
write!(out, "=External Dependencies=\n")?;
let root = self.get_root();
writeln!(out, "Crate info:")?;
writeln!(out, "name {}{}", root.name, root.extra_filename)?;
writeln!(out, "hash {} stable_crate_id {:?}", root.hash, root.stable_crate_id)?;
writeln!(out, "proc_macro {:?}", root.proc_macro_data.is_some())?;
writeln!(out, "=External Dependencies=")?;
for (i, dep) in root.crate_deps.decode(self).enumerate() {
write!(out, "{} {}{}\n", i + 1, dep.name, dep.extra_filename)?;
writeln!(
out,
"{} {}{} hash {} host_hash {:?} kind {:?}",
i + 1,
dep.name,
dep.extra_filename,
dep.hash,
dep.host_hash,
dep.kind
)?;
}
write!(out, "\n")?;
Ok(())
Expand Down

0 comments on commit cef3ab7

Please sign in to comment.