diff options
| author | LeSeulArtichaut <leseulartichaut@gmail.com> | 2020-05-27 10:04:09 +0200 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2020-05-27 15:17:33 -0500 |
| commit | 69801e4c014eadad6e70b99fdb14e44a5bf105ad (patch) | |
| tree | bef20931803e6f5557dd04235b77682ad9f6cf05 /src/doc/rustc-dev-guide | |
| parent | fd04d6e662e40b60907333671db23e16ed787402 (diff) | |
| download | rust-69801e4c014eadad6e70b99fdb14e44a5bf105ad.tar.gz rust-69801e4c014eadad6e70b99fdb14e44a5bf105ad.zip | |
Add definition of `niche` to the glossary
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/appendix/glossary.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/appendix/glossary.md b/src/doc/rustc-dev-guide/src/appendix/glossary.md index 0b4aad6583e..f2fdfe21718 100644 --- a/src/doc/rustc-dev-guide/src/appendix/glossary.md +++ b/src/doc/rustc-dev-guide/src/appendix/glossary.md @@ -47,6 +47,7 @@ miri <div id="miri"/> | An interpreter for MIR used for cons monomorphization <div id="mono"/> | The process of taking generic implementations of types and functions and instantiating them with concrete types. For example, in the code we might have `Vec<T>`, but in the final executable, we will have a copy of the `Vec` code for every concrete type used in the program (e.g. a copy for `Vec<usize>`, a copy for `Vec<MyStruct>`, etc). normalize <div id="normalize"/> | A general term for converting to a more canonical form, but in the case of rustc typically refers to [associated type normalization](../traits/goals-and-clauses.html#normalizeprojection---type). newtype <div id="newtype"/> | A wrapper around some other type (e.g., `struct Foo(T)` is a "newtype" for `T`). This is commonly used in Rust to give a stronger type for indices. +Niche | Invalid bit patterns for a type *that can be used* for layout optimizations. Some types, like the `NonZero*` integers or the reference `&T` are invalid for certain bit patterns, in these cases a 0 bitstring. This means the compiler can perform layout optimizations by taking advantage of the invalid "niche value". An example application for this is the [*Discriminant ellision on `Option`-like enums*](https://rust-lang.github.io/unsafe-code-guidelines/layout/enums.html#discriminant-elision-on-option-like-enums), which allows using a type's niche to determine the `enum` variant without storing a discriminant. NLL <div id="nll"/> | Short for [non-lexical lifetimes](../borrow_check/region_inference.html), this is an extension to Rust's borrowing system to make it be based on the control-flow graph. node-id or NodeId <div id="node-id"/> | An index identifying a particular node in the AST or HIR; gradually being phased out and replaced with `HirId`. See [the HIR chapter for more](../hir.html#identifiers-in-the-hir). obligation <div id="obligation"/> | Something that must be proven by the trait system. ([see more](../traits/resolution.html)) |
