diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index a2d1a6a23c63..af7745d6126c 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1550,7 +1550,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) { writeln!( w, "
Note: Most layout information is \
- completely unstable and may be different between compiler versions. \
+ completely unstable and may be different between compiler versions and platforms. \
The only exception is types with certain repr(...) attributes. \
Please see the Rust Reference’s \
“Type Layout” \
@@ -1559,11 +1559,12 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
if ty_layout.layout.abi.is_unsized() {
writeln!(w, "
Size: (unsized)
"); } else { + let bytes = ty_layout.layout.size.bytes(); writeln!( w, "Size: {size} byte{pl}
", - size = ty_layout.layout.size.bytes(), - pl = if ty_layout.layout.size.bytes() == 1 { "" } else { "s" }, + size = bytes, + pl = if bytes == 1 { "" } else { "s" }, ); } writeln!(w, "