Skip to content

Commit 3bb1b1a

Browse files
Renamed appendices and added @nrc's guide
1 parent 83d5f64 commit 3bb1b1a

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
@@ -46,6 +46,10 @@
4646
- [miri const evaluator](./miri.md)
4747
- [Parameter Environments](./param_env.md)
4848
- [Generating LLVM IR](./trans.md)
49-
- [Background material](./background.md)
50-
- [Glossary](./glossary.md)
51-
- [Code Index](./code-index.md)
49+
50+
---
51+
52+
- [Appendix A: Stupid Stats](./appendix-stupid-stats.md)
53+
- [Appendix B: Background material](./appendix-background.md)
54+
- [Appendix C: Glossary](./appendix-glossary.md)
55+
- [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))
@@ -39,7 +38,7 @@ obligation | something that must be proven by the trait system ([s
3938
projection | a general term for a "relative path", e.g. `x.f` is a "field projection", and `T::Item` is an ["associated type projection"](./traits-goals-and-clauses.html#trait-ref)
4039
promoted constants | constants extracted from a function and lifted to static scope; see [this section](./mir.html#promoted) for more details.
4140
provider | the function that executes a query ([see more](query.html))
42-
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)
41+
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)
4342
query | perhaps some sub-computation during compilation ([see more](query.html))
4443
region | another term for "lifetime" often used in the literature and in the borrow checker.
4544
sess | the compiler session, which stores global data used throughout compilation
@@ -57,7 +56,7 @@ token | the smallest unit of parsing. Tokens are produced aft
5756
trans | the code to translate MIR into LLVM IR.
5857
trait reference | a trait and values for its type parameters ([see more](ty.html)).
5958
ty | the internal representation of a type ([see more](ty.html)).
60-
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).
59+
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).
6160

6261
[LLVM]: https://llvm.org/
6362
[lto]: https://llvm.org/docs/LinkTimeOptimization.html

0 commit comments

Comments
 (0)