Skip to content

Commit 369a8ac

Browse files
committed
List all defined and required lang items in -Zls
1 parent 7279cc0 commit 369a8ac

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,26 @@ impl MetadataBlob {
778778
}
779779
write!(out, "\n")?;
780780

781+
writeln!(out, "\n=Lang items=")?;
782+
for (id, lang_item) in root.lang_items.decode(self) {
783+
writeln!(
784+
out,
785+
"{} = crate{}",
786+
lang_item.name(),
787+
DefPath::make(LOCAL_CRATE, id, |parent| root
788+
.tables
789+
.def_keys
790+
.get(self, parent)
791+
.unwrap()
792+
.decode(self))
793+
.to_string_no_crate_verbose()
794+
)?;
795+
}
796+
for lang_item in root.lang_items_missing.decode(self) {
797+
writeln!(out, "{} = <missing>", lang_item.name())?;
798+
}
799+
write!(out, "\n")?;
800+
781801
Ok(())
782802
}
783803
}

0 commit comments

Comments
 (0)