diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2023-03-04 12:07:29 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2023-03-04 12:07:29 +0000 |
| commit | 7520155e4ebe133859e379624283aaafdcb6e72b (patch) | |
| tree | 399c03fb4e6dc7a5754968ff61dee9bb5671be7a /src | |
| parent | 13471d3b2046cce78181dde6cfc146c09f55e29e (diff) | |
| download | rust-7520155e4ebe133859e379624283aaafdcb6e72b.tar.gz rust-7520155e4ebe133859e379624283aaafdcb6e72b.zip | |
rustdoc: Note in a type's layout/size if it is uninhabited
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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, + " (<a href=\"https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited\">uninhabited</a>)" + ); + } } } |
