Skip to content

Commit

Permalink
Use 1-ZST terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Aug 15, 2019
1 parent 58558fe commit b0f2ef5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions reference/src/layout/structs-and-tuples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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

Expand Down Expand Up @@ -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

0 comments on commit b0f2ef5

Please sign in to comment.