From 24706803abcf0f528e3b450a825cd2bdc5d17f49 Mon Sep 17 00:00:00 2001 From: AdityaProCoder <83160620+AdityaProCoder@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:59:13 +0530 Subject: [PATCH] Fix the glossary definition of codegen The glossary said codegen is "the code to translate MIR into LLVM IR", which describes rustc's own work rather than what codegen is: rustc does not implement code generation, it hands that to LLVM or to another backend. The codegen chapter already puts it the other way round ("the part of the compiler that actually generates an executable binary ... rustc doesn't implement codegen itself ... there are no hard boundaries"), so the glossary now agrees with it and links there. The `trans` entry repeated the same wording. It now follows the shape of the `LTA` entry instead: the expansion of the abbreviation, then the term it was renamed to, without restating the rename twice. --- src/appendix/glossary.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/appendix/glossary.md b/src/appendix/glossary.md index 18ddf069fd..5f048e176e 100644 --- a/src/appendix/glossary.md +++ b/src/appendix/glossary.md @@ -14,7 +14,7 @@ Term | Meaning body | The definition of a function or constant that contains "executable code". `BodyId` | An identifier that refers to a specific [body](#body) in the crate. See [the HIR chapter for more](../hir.md#identifiers-in-the-hir). bound variable | A _bound variable_ is one that is declared within an expression or term (in the general sense). For example, the variable `a` is bound within the closure expression `\|a\| a * 2` and lifetime variable `'a` is bound within the type expression `for<'a> fn(&'a str) -> bool`. See [the background chapter for more](./background.md#free-vs-bound) -codegen | Short for _code generation_. The code to translate MIR into LLVM IR. +codegen | Short for _code generation_, the part of the compiler that actually generates an executable binary, which rustc delegates to LLVM or to one of the other backends. Many parts of the backend carry `codegen` in their names, so the boundary is not sharp. ([see more](../backend/codegen.md)) codegen unit | When we produce LLVM IR, we group the Rust code into a number of codegen units (sometimes abbreviated as CGUs). Each of these units is processed by LLVM independently from one another, enabling parallelism. They are also the unit of incremental re-use. ([see more](../backend/codegen.md)) completeness | A technical term in type theory, it 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"). control-flow graph, CFG | A representation of the control-flow of a program; see [the background chapter for more](./background.md#cfg) @@ -101,7 +101,7 @@ Term | Meaning token | The smallest unit of parsing. Tokens are produced after lexing ([see more](../the-parser.md)). [TLS] | _Thread-local storage_. Variables may be defined so that each thread has its own copy (rather than all threads sharing the variable). This has some interactions with LLVM. Not all platforms support TLS. trait reference, trait ref | The name of a trait along with a suitable list of generic arguments. ([see more](../traits/goals-and-clauses.md#trait-ref)) -trans 👎 | Short for _translation_, the code to translate MIR into LLVM IR. **Renamed to** [codegen](#codegen). +trans 👎 | Short for _translation_. **Renamed to [codegen](#codegen)**. `Ty` | The internal representation of a type. ([see more](../ty.md)) `TyCtxt` | The data structure often referred to as [`tcx`](#tcx) in code which provides access to session data and the query system. Type-Level Term | An expression at the type level, such as a Type or Const Generic.