Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix F — Glossary

Term Clusters

Group Vocabulary by the Invariant It Helps You See

ownershipmove borrow droplifetime slice pincompilerAST HIR MIRtrait solver CFGAPItrait object GATtypestate semverasyncfuture send synccancellationsystemsunsafe FFI atomicsrepr(C) niche UB

This glossary defines the Rust-specific terms most likely to appear in compiler errors, RFCs, code review comments, and serious codebases.

TermMeaning
aliasingMultiple references or access paths pointing at the same underlying data
API surfaceThe set of public items and behaviors downstream users depend on
auto traitA trait the compiler can automatically determine, such as Send, Sync, or Unpin
borrowA non-owning reference to a value, either shared (&T) or mutable (&mut T)
borrow checkerThe compiler analysis that enforces ownership, borrowing, and lifetime invariants
cancellation safetyThe property that dropping an in-flight future does not violate invariants or lose required state updates
coherenceThe rule system that ensures trait impl selection remains unambiguous across crates
combinatorA method like map, and_then, or filter that transforms structured values such as iterators or results
const genericA generic parameter whose value is a compile-time constant, such as an array length
control-flow graphA graph of basic blocks and branches used for compiler analyses like borrow checking
crateA compilation unit in Rust; a binary crate produces an executable, a library crate produces reusable code
deriveA macro-generated implementation for traits like Debug, Clone, or Serialize
discriminantThe tag that identifies which variant of an enum is currently present
doctestA test extracted from documentation examples
dropThe destructor phase that runs when an owned value goes out of scope
dyn traitA trait object used for runtime polymorphism through a vtable
elisionCompiler rules that infer omitted lifetime annotations in common patterns
enumA type with multiple named variants, often carrying different data
FFIForeign Function Interface; the boundary between Rust and other languages such as C
fat pointerA pointer plus extra metadata, such as a length for slices or vtable for trait objects
feature flagA Cargo-controlled conditional compilation switch
futureA value representing work that may complete later and can be polled toward completion
GATGeneric Associated Type; an associated type that itself takes generic or lifetime parameters
HIRHigh-level Intermediate Representation; a desugared compiler representation used in semantic analysis
hygieneThe macro property that prevents accidental name capture or leakage between generated code and surrounding code
impl blockA block that defines methods or associated functions for a type or trait implementation
impl traitSyntax for opaque return types or generic-like argument constraints with static dispatch
interior mutabilityMutation that occurs through shared references using types like Cell, RefCell, Mutex, or atomics
invariantA property that must always remain true for a program or abstraction to stay correct
iterator invalidationA bug where a collection mutation makes an existing iterator or reference invalid
lifetimeA compile-time relationship constraining how long references may remain valid relative to owners and other borrows
livenessThe compiler notion of whether a value or borrow may still be used in future control flow
macro_rules!Rust’s declarative macro system based on token-tree pattern matching
MIRMid-level Intermediate Representation; a control-flow-oriented compiler representation used for borrow checking and optimizations
monomorphizationGenerating concrete versions of generic code for each used type
moveOwnership transfer from one binding or scope to another
NLLNon-Lexical Lifetimes; a borrow analysis improvement that ends borrows at last use rather than only at scope end
object safetyThe set of rules that determine whether a trait can be used as a trait object
orphan ruleA coherence rule preventing you from implementing external traits for external types unless one side is local
owned valueA value responsible for its own cleanup or the cleanup of resources it controls
pinningPreventing a value from being moved in memory after certain invariants depend on its address
preludeA set of standard items automatically imported into most Rust modules
procedural macroA macro implemented as Rust code that transforms token streams during compilation
RAIIResource Acquisition Is Initialization; tying resource cleanup to object lifetime
referenceA safe pointer-like borrow tracked by the compiler
repr(C)A layout attribute used to request C-compatible field ordering and ABI expectations
semverSemantic versioning; the compatibility model used by Cargo and crates.io
sliceA borrowed view into contiguous data, such as &[T] or &str
smart pointerA type like Box, Rc, or Arc that manages ownership semantics beyond raw values
state machineA representation of computation as a set of states and transitions; futures are compiled this way
structA named aggregate type with fields
traitA named set of capabilities or required behavior
trait objectA runtime-polymorphic value accessed through dyn Trait
trait solverCompiler machinery that proves whether required trait obligations hold
typestateAn API pattern encoding valid object states in the type system
unsafeA Rust escape hatch for operations the compiler cannot prove safe, with the proof burden shifted to the programmer
vtableA table of function pointers and metadata used by trait objects for dynamic dispatch
workspaceA set of related crates managed together by Cargo
zero-cost abstractionAn abstraction that does not impose unavoidable runtime cost compared with a hand-written low-level equivalent

How to Use the Glossary

  • When a compiler message uses unfamiliar vocabulary, check the term here before guessing.
  • When reading RFCs, map new concepts back to glossary terms you already understand.
  • When reviewing code, ask which glossary terms describe the abstraction’s core invariant.