From 7520155e4ebe133859e379624283aaafdcb6e72b Mon Sep 17 00:00:00 2001 From: clubby789 Date: Sat, 4 Mar 2023 12:07:29 +0000 Subject: rustdoc: Note in a type's layout/size if it is uninhabited --- src/librustdoc/html/render/print_item.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librustdoc/html/render') diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 2869a39613f..08796f10d92 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1839,6 +1839,12 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) { } else { let size = layout.size.bytes() - tag_size; write!(w, "{size} byte{pl}", pl = if size == 1 { "" } else { "s" },); + if layout.abi.is_uninhabited() { + write!( + w, + " (uninhabited)" + ); + } } } -- cgit 1.4.1-3-g733a5