List all defined and required lang items in -Zls

This commit is contained in:
bjorn3 2023-09-10 12:55:54 +00:00
parent 7279cc0abd
commit 369a8ac52b

View File

@ -778,6 +778,26 @@ pub(crate) fn list_crate_metadata(&self, out: &mut dyn io::Write) -> io::Result<
}
write!(out, "\n")?;
writeln!(out, "\n=Lang items=")?;
for (id, lang_item) in root.lang_items.decode(self) {
writeln!(
out,
"{} = crate{}",
lang_item.name(),
DefPath::make(LOCAL_CRATE, id, |parent| root
.tables
.def_keys
.get(self, parent)
.unwrap()
.decode(self))
.to_string_no_crate_verbose()
)?;
}
for lang_item in root.lang_items_missing.decode(self) {
writeln!(out, "{} = <missing>", lang_item.name())?;
}
write!(out, "\n")?;
Ok(())
}
}