We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3262a0a commit 823937cCopy full SHA for 823937c
reference/src/glossary.md
@@ -61,12 +61,17 @@ In this document, *layout* and *representation* are not synonyms.
61
62
#### Niche
63
64
-Invalid bit-patters that will be used by layout optimizations.
+Invalid bit-patterns 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
+While all niches are invalid bit-patterns, not all invalid bit-patterns are
71
+niches. For example, the "all bits uninitialized" is an invalid bit-pattern for
72
+`&mut T`, but this bit-pattern is not used by layout optimizations, and is not a
73
+niche.
74
+
75
76
### TODO
77
0 commit comments