Skip to content

Commit b0f2ef5

Browse files
committed
Use 1-ZST terminology
1 parent 58558fe commit b0f2ef5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

reference/src/layout/structs-and-tuples.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ x: u16, y: T }` where `T = u32` are not guaranteed to be identical.
125125
#### Default layout of structs with a single non-zero-sized field
126126

127127
The default layout of structs with a single non-zero-sized field is the same as
128-
the layout of that field if the alignment requirement of all other fields is 1.
128+
the layout of that field if all other fields are [1-ZST]
129129

130130
For example, the layout of:
131131

@@ -140,8 +140,7 @@ is the same as the layout of `i32`, but the layout of:
140140
struct SomeOtherStruct(i32, Zst);
141141
```
142142

143-
is **unspecified**, since there is a zero-sized field in `SomeOtherStruct` with
144-
alignment greater than 1.
143+
is **unspecified**, since `Zst` is not a [1-ZST].
145144

146145
#### Unresolved questions
147146

@@ -402,3 +401,5 @@ proposal (and -- further -- it does not match our existing behavior):
402401
thread](https://github.com/rust-rfcs/unsafe-code-guidelines/pull/31#discussion_r224955817)).
403402
- Many people would prefer the name ordering to be chosen for
404403
"readability" and not optimal layout.
404+
405+
[1-ZST]: ../glossary.md#zero-sized-type--zst

0 commit comments

Comments
 (0)