Skip to content

Commit cef3ab7

Browse files
committed
Print more crate details in -Zls
Useful for debugging crate hash and resolution issues.
1 parent 406d4a9 commit cef3ab7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,23 @@ impl MetadataBlob {
601601
}
602602

603603
crate fn list_crate_metadata(&self, out: &mut dyn io::Write) -> io::Result<()> {
604-
write!(out, "=External Dependencies=\n")?;
605604
let root = self.get_root();
605+
writeln!(out, "Crate info:")?;
606+
writeln!(out, "name {}{}", root.name, root.extra_filename)?;
607+
writeln!(out, "hash {} stable_crate_id {:?}", root.hash, root.stable_crate_id)?;
608+
writeln!(out, "proc_macro {:?}", root.proc_macro_data.is_some())?;
609+
writeln!(out, "=External Dependencies=")?;
606610
for (i, dep) in root.crate_deps.decode(self).enumerate() {
607-
write!(out, "{} {}{}\n", i + 1, dep.name, dep.extra_filename)?;
611+
writeln!(
612+
out,
613+
"{} {}{} hash {} host_hash {:?} kind {:?}",
614+
i + 1,
615+
dep.name,
616+
dep.extra_filename,
617+
dep.hash,
618+
dep.host_hash,
619+
dep.kind
620+
)?;
608621
}
609622
write!(out, "\n")?;
610623
Ok(())

0 commit comments

Comments
 (0)