Skip to content

Commit 95a102c

Browse files
committed
Define niche in the glossary
1 parent cceb00f commit 95a102c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

reference/src/glossary.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,17 @@ Moreover, the layout of a type records its *function call ABI* (or just *ABI* fo
5959
Note: Originally, *layout* and *representation* were treated as synonyms, and Rust language features like the `#[repr]` attribute reflect this.
6060
In this document, *layout* and *representation* are not synonyms.
6161

62+
#### Niche
63+
64+
Invalid bit-patters that will be used by layout optimizations.
65+
66+
For example, `&mut T` has at least one niche, the "all zeros" bit-pattern. This
67+
niche is used by layout optimizations like "`enum` discriminant elision" to
68+
guarantee that `Option<&mut T>` has the same size as `&mut T`.
69+
70+
6271
### TODO
6372

64-
* *niche*
6573
* *tag*
6674
* *rvalue*
6775
* *lvalue*

0 commit comments

Comments
 (0)