Skip to content

Commit

Permalink
Update reference/src/glossary.md
Browse files Browse the repository at this point in the history
Co-Authored-By: Ralf Jung <[email protected]>
  • Loading branch information
gnzlbg and RalfJung committed Jul 23, 2019
1 parent 6c81407 commit 6246534
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions reference/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ The *layout* of a type defines:
* its [niches][Niche],
* its call abi.

Note: due to discriminant-elision optimizations, niches are required to compute
the layout of, e.g., `Option<T>`, from the layout of `T`.

Note: Originally, *layout* and *representation* were treated as synonyms, and Rust language features like the `#[repr]` attribute reflect this.
In this document, *layout* and *representation* are not synonyms.

<<<<<<< HEAD
#### Niche

The *niche* of a type determines invalid bit-patterns that will be used by layout optimizations.
Expand All @@ -78,16 +80,12 @@ While all niches are invalid bit-patterns, not all invalid bit-patterns are
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.
=======
Note: due to discriminant-elision optimizations, niches are required to compute
the layout of, e.g., `Option<T>`, from the layout of `T`.
>>>>>>> Add note about why niches need to be part of the layout

#### Call ABI

The *call ABI* determines how a type is passed *by value* across a function boundary.

Note: The call ABI is not stable. Currently, it is one of:
Note: The set of possible call ABIs is not stable. Currently, it consists of:

```rust,ignore
enum Abi {
Expand Down

0 comments on commit 6246534

Please sign in to comment.