Skip to content

Commit c2d366f

Browse files
Renamed appendices and added @nrc's guide
1 parent 96e8346 commit c2d366f

File tree

8 files changed

+419
-20
lines changed

8 files changed

+419
-20
lines changed

src/SUMMARY.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
- [miri const evaluator](./miri.md)
3535
- [Parameter Environments](./param_env.md)
3636
- [Generating LLVM IR](./trans.md)
37-
- [Background material](./background.md)
38-
- [Glossary](./glossary.md)
39-
- [Code Index](./code-index.md)
37+
38+
---
39+
40+
- [Appendix A: Stupid Stats](./appendix-stupid-stats.md)
41+
- [Appendix B: Background material](./appendix-background.md)
42+
- [Appendix C: Glossary](./appendix-glossary.md)
43+
- [Appendix D: Code Index](./appendix-code-index.md)

src/background.md renamed to src/appendix-background.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Background topics
1+
# Appendix B: Background topics
22

33
This section covers a numbers of common compiler terms that arise in
44
this guide. We try to give the general definition while providing some

src/code-index.md renamed to src/appendix-code-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Code Index
1+
# Appendix D: Code Index
22

33
rustc has a lot of important data structures. This is an attempt to give some
44
guidance on where to learn more about some of the key data structures of the

src/glossary.md renamed to src/appendix-glossary.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
Glossary
2-
--------
1+
# Appendix C: Glossary
32

43
The compiler uses a number of...idiosyncratic abbreviations and things. This glossary attempts to list them and give you a few pointers for understanding them better.
54

65
Term | Meaning
76
------------------------|--------
87
AST | the abstract syntax tree produced by the syntax crate; reflects user syntax very closely.
9-
binder | a "binder" is a place where a variable or type is declared; for example, the `<T>` is a binder for the generic type parameter `T` in `fn foo<T>(..)`, and \|`a`\|` ...` is a binder for the parameter `a`. See [the background chapter for more](./background.html#free-vs-bound)
10-
bound variable | a "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expession \|`a`\|` a * 2`. See [the background chapter for more](./background.html#free-vs-bound)
8+
binder | a "binder" is a place where a variable or type is declared; for example, the `<T>` is a binder for the generic type parameter `T` in `fn foo<T>(..)`, and \|`a`\|` ...` is a binder for the parameter `a`. See [the background chapter for more](./appendix-background.html#free-vs-bound)
9+
bound variable | a "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expession \|`a`\|` a * 2`. See [the background chapter for more](./appendix-background.html#free-vs-bound)
1110
codegen unit | when we produce LLVM IR, we group the Rust code into a number of codegen units. Each of these units is processed by LLVM independently from one another, enabling parallelism. They are also the unit of incremental re-use.
1211
completeness | completeness is a technical term in type theory. Completeness means that every type-safe program also type-checks. Having both soundness and completeness is very hard, and usually soundness is more important. (see "soundness").
13-
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./background.html#cfg)
12+
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./appendix-background.html#cfg)
1413
cx | we tend to use "cx" as an abbrevation for context. See also `tcx`, `infcx`, etc.
1514
DAG | a directed acyclic graph is used during compilation to keep track of dependencies between queries. ([see more](incremental-compilation.html))
16-
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./background.html#dataflow)
15+
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./appendix-background.html#dataflow)
1716
DefId | an index identifying a definition (see `librustc/hir/def_id.rs`). Uniquely identifies a `DefPath`.
18-
free variable | a "free variable" is one that is not bound within an expression or term; see [the background chapter for more](./background.html#free-vs-bound)
17+
free variable | a "free variable" is one that is not bound within an expression or term; see [the background chapter for more](./appendix-background.html#free-vs-bound)
1918
'gcx | the lifetime of the global arena ([see more](ty.html))
2019
generics | the set of generic type parameters defined on a type or item
2120
HIR | the High-level IR, created by lowering and desugaring the AST ([see more](hir.html))
@@ -37,7 +36,7 @@ node-id or NodeId | an index identifying a particular node in the AST or
3736
obligation | something that must be proven by the trait system ([see more](trait-resolution.html))
3837
promoted constants | constants extracted from a function and lifted to static scope; see [this section](./mir.html#promoted) for more details.
3938
provider | the function that executes a query ([see more](query.html))
40-
quantified | in math or logic, existential and universal quantification are used to ask questions like "is there any type T for which is true?" or "is this true for all types T?"; see [the background chapter for more](./background.html#quantified)
39+
quantified | in math or logic, existential and universal quantification are used to ask questions like "is there any type T for which is true?" or "is this true for all types T?"; see [the background chapter for more](./appendix-background.html#quantified)
4140
query | perhaps some sub-computation during compilation ([see more](query.html))
4241
region | another term for "lifetime" often used in the literature and in the borrow checker.
4342
sess | the compiler session, which stores global data used throughout compilation
@@ -54,7 +53,7 @@ token | the smallest unit of parsing. Tokens are produced aft
5453
trans | the code to translate MIR into LLVM IR.
5554
trait reference | a trait and values for its type parameters ([see more](ty.html)).
5655
ty | the internal representation of a type ([see more](ty.html)).
57-
variance | variance determines how changes to a generic type/lifetime parameter affect subtyping; for example, if `T` is a subtype of `U`, then `Vec<T>` is a subtype `Vec<U>` because `Vec` is *covariant* in its generic parameter. See [the background chapter for more](./background.html#variance).
56+
variance | variance determines how changes to a generic type/lifetime parameter affect subtyping; for example, if `T` is a subtype of `U`, then `Vec<T>` is a subtype `Vec<U>` because `Vec` is *covariant* in its generic parameter. See [the background chapter for more](./appendix-background.html#variance).
5857

5958
[LLVM]: https://llvm.org/
6059
[lto]: https://llvm.org/docs/LinkTimeOptimization.html

0 commit comments

Comments
 (0)