Skip to content

Commit 3e4c891

Browse files
authored
Merge pull request #173 from gnzlbg/zstg
Document the abbreviation of zero-sized types.
2 parents ea3dbdf + 4a4f964 commit 3e4c891

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

reference/src/glossary.md

+8
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ niches. For example, the "all bits uninitialized" is an invalid bit-pattern for
129129
`&mut T`, but this bit-pattern cannot be used by layout optimizations, and is not a
130130
niche.
131131

132+
#### Zero-sized type / ZST
133+
134+
Types with zero size are called zero-sized types, which is abbreviated as "ZST".
135+
This document also uses the "1-ZST" abbreviation, which stands for "one-aligned
136+
zero-sized type", to refer to zero-sized types with an alignment requirement of 1.
137+
138+
For example, `()` is a "1-ZST" but `[u16; 0]` is not because it has an alignment
139+
requirement of 2.
132140

133141
### TODO
134142

0 commit comments

Comments
 (0)