From b0f2ef56020cb883a244e09900bc1d971ae75584 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Thu, 15 Aug 2019 08:30:27 +0200 Subject: [PATCH] Use 1-ZST terminology --- reference/src/layout/structs-and-tuples.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/src/layout/structs-and-tuples.md b/reference/src/layout/structs-and-tuples.md index a7ca4587..ba09158e 100644 --- a/reference/src/layout/structs-and-tuples.md +++ b/reference/src/layout/structs-and-tuples.md @@ -125,7 +125,7 @@ x: u16, y: T }` where `T = u32` are not guaranteed to be identical. #### Default layout of structs with a single non-zero-sized field The default layout of structs with a single non-zero-sized field is the same as -the layout of that field if the alignment requirement of all other fields is 1. +the layout of that field if all other fields are [1-ZST] For example, the layout of: @@ -140,8 +140,7 @@ is the same as the layout of `i32`, but the layout of: struct SomeOtherStruct(i32, Zst); ``` -is **unspecified**, since there is a zero-sized field in `SomeOtherStruct` with -alignment greater than 1. +is **unspecified**, since `Zst` is not a [1-ZST]. #### Unresolved questions @@ -402,3 +401,5 @@ proposal (and -- further -- it does not match our existing behavior): thread](https://github.com/rust-rfcs/unsafe-code-guidelines/pull/31#discussion_r224955817)). - Many people would prefer the name ordering to be chosen for "readability" and not optimal layout. + +[1-ZST]: ../glossary.md#zero-sized-type--zst