about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-01-16 20:13:11 -0500
committerGitHub <noreply@github.com>2018-01-16 20:13:11 -0500
commit13b379d3d344a62b400a75cd95c76ac406fb101d (patch)
treecc7073419a8450b5777bbb9748a4d40948094a2f /src/doc/rustc-dev-guide
parentc6f3f051a5925c531936dfd399cf722773af305b (diff)
parentc08d4c0bfd488473fed766f72552ad565f468f15 (diff)
downloadrust-13b379d3d344a62b400a75cd95c76ac406fb101d.tar.gz
rust-13b379d3d344a62b400a75cd95c76ac406fb101d.zip
Merge pull request #4 from mark-i-m/glossary
Add glossary
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/src/SUMMARY.md2
-rw-r--r--src/doc/rustc-dev-guide/src/src/glossary.md31
2 files changed, 32 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/src/SUMMARY.md b/src/doc/rustc-dev-guide/src/src/SUMMARY.md
index 134014963cb..21c87188555 100644
--- a/src/doc/rustc-dev-guide/src/src/SUMMARY.md
+++ b/src/doc/rustc-dev-guide/src/src/SUMMARY.md
@@ -16,4 +16,4 @@
 - [MIR borrowck](./chap-140-mir-borrowck.md)
 - [MIR optimizations](./chap-150-mir-optimizations.md)
 - [trans: generating LLVM IR](./chap-160-trans.md)
-
+- [Glossary](./glossary.md)
diff --git a/src/doc/rustc-dev-guide/src/src/glossary.md b/src/doc/rustc-dev-guide/src/src/glossary.md
new file mode 100644
index 00000000000..b66e17ea3c1
--- /dev/null
+++ b/src/doc/rustc-dev-guide/src/src/glossary.md
@@ -0,0 +1,31 @@
+Glossary
+--------
+
+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.
+
+Term                    | Meaning
+------------------------|--------
+AST                     |  the abstract syntax tree produced by the syntax crate; reflects user syntax very closely.
+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.
+cx                      |  we tend to use "cx" as an abbrevation for context. See also `tcx`, `infcx`, etc.
+DefId                   |  an index identifying a definition (see `librustc/hir/def_id.rs`). Uniquely identifies a `DefPath`.
+HIR                     |  the High-level IR, created by lowering and desugaring the AST. See `librustc/hir`.
+HirId                   |  identifies a particular node in the HIR by combining a def-id with an "intra-definition offset".
+'gcx                    |  the lifetime of the global arena (see `librustc/ty`).
+generics                |  the set of generic type parameters defined on a type or item
+ICE                     |  internal compiler error. When the compiler crashes.
+infcx                   |  the inference context (see `librustc/infer`)
+MIR                     |  the Mid-level IR that is created after type-checking for use by borrowck and trans. Defined in the `src/librustc/mir/` module, but much of the code that manipulates it is found in `src/librustc_mir`.
+obligation              |  something that must be proven by the trait system; see `librustc/traits`.
+local crate             |  the crate currently being compiled.
+node-id or NodeId       |  an index identifying a particular node in the AST or HIR; gradually being phased out and replaced with `HirId`.
+query                   |  perhaps some sub-computation during compilation; see `librustc/maps`.
+provider                |  the function that executes a query; see `librustc/maps`.
+sess                    |  the compiler session, which stores global data used throughout compilation
+side tables             |  because the AST and HIR are immutable once created, we often carry extra information about them in the form of hashtables, indexed by the id of a particular node.
+span                    |  a location in the user's source code, used for error reporting primarily. These are like a file-name/line-number/column tuple on steroids: they carry a start/end point, and also track macro expansions and compiler desugaring. All while being packed into a few bytes (really, it's an index into a table). See the Span datatype for more.
+substs                  |  the substitutions for a given generic type or item (e.g., the `i32`, `u32` in `HashMap<i32, u32>`)
+tcx                     |  the "typing context", main data structure of the compiler (see `librustc/ty`).
+trans                   |  the code to translate MIR into LLVM IR.
+trait reference         |  a trait and values for its type parameters (see `librustc/ty`).
+ty                      |  the internal representation of a type (see `librustc/ty`).