Skip to content

Document the abbreviation of zero-sized types. #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reference/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ niches. For example, the "all bits uninitialized" is an invalid bit-pattern for
`&mut T`, but this bit-pattern cannot be used by layout optimizations, and is not a
niche.

#### Zero-sized type / ZST

Types with zero size are called zero-sized types, which is abbreviated as "ZST".
This document also uses the "1-ZST" abbreviation, which stands for "one-aligned
zero-sized type", to refer to zero-sized types with an alignment requirement of 1.

For example, `()` is a "1-ZST" but `[u16; 0]` is not because it has an alignment
requirement of two.

### TODO

Expand Down