Note: Most layout information is \
- completely unstable and may even differ between compilations. \
- The only exception is types with certain repr(...) attributes. \
- Please see the Rust Reference’s \
- “Type Layout” \
- chapter for details on type layout guarantees.
Size: ")?; - write_size_of_layout(&mut f, &ty_layout.layout.0, 0); - writeln!(f, "
")?; - if let Variants::Multiple { variants, tag, tag_encoding, .. } = - &ty_layout.layout.variants() - { - if !variants.is_empty() { - f.write_str( - "Size for each variant:
\ -{name}: ")?;
- write_size_of_layout(&mut f, layout, tag_size);
- writeln!(&mut f, "Note: Unable to compute type layout, \ - possibly due to this type having generic parameters. \ - Layout can only be computed for concrete, fully-instantiated types.
" - )?; - } - // This kind of error probably can't happen with valid code, but we don't - // want to panic and prevent the docs from building, so we just let the - // user know that we couldn't compute the layout. - Err(LayoutError::SizeOverflow(_)) => { - writeln!( - f, - "Note: Encountered an error during type layout; \ - the type was too big.
" - )?; - } - Err(LayoutError::NormalizationFailure(_, _)) => { - writeln!( - f, - "Note: Encountered an error during type layout; \ - the type failed to be normalized.
" - )?; - } - } - - writeln!(f, " {# #}
+ Note: Most layout information is completely {#+ #}
+ unstable and may even differ between compilations. {#+ #}
+ The only exception is types with certain repr(...) {#+ #}
+ attributes. Please see the Rust Reference’s {#+ #}
+ “Type Layout” {#+ #}
+ chapter for details on type layout guarantees. {# #}
+
Size: {{ self.write_size(ty_layout.layout.0.borrow(), 0) | safe }}
{# #} + {% if let Some(variants) = self.variants() %} +Size for each variant:
{# #} +{{ self.variant_name(index.clone()) }}: {#+ #}
+ {{ self.write_size(layout, self.tag_size()) | safe }}
+ Note: Unable to compute type layout, {#+ #} + possibly due to this type having generic parameters. {#+ #} + Layout can only be computed for concrete, fully-instantiated types.
{# #} + {# This kind of error probably can't happen with valid code, but we don't + want to panic and prevent the docs from building, so we just let the + user know that we couldn't compute the layout. #} + {% when Err(LayoutError::SizeOverflow(_)) %} +Note: Encountered an error during type layout; {#+ #} + the type was too big.
{# #} + {% when Err(LayoutError::NormalizationFailure(_, _)) %} +Note: Encountered an error during type layout; {#+ #} + the type failed to be normalized.
{# #} + {% endmatch %} +