diff --git a/src/glossary.md b/src/glossary.md index defa63f82..1864ff4b4 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -1,6 +1,6 @@ # Glossary -### Abstract Syntax Tree +### Abstract syntax tree An ‘abstract syntax tree’, or ‘AST’, is an intermediate representation of the structure of the program when the compiler is compiling it. @@ -23,11 +23,12 @@ An array, sometimes also called a fixed-size array or an inline array, is a valu describing a collection of elements, each selected by an index that can be computed at run time by the program. It occupies a contiguous region of memory. -### Associated Item +### Associated item An associated item is an item that is associated with another item. Associated -items are defined in [implementations] and declared in [traits]. Only functions, -constants, and type aliases can be associated. +items are defined in [implementations] and declared in [traits]. Only +functions, constants, and type aliases can be associated. Contrast to a [free +item]. ### Bound @@ -48,7 +49,7 @@ run when it involves polymorphism. Two major forms of dispatch are static dispat dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch through a mechanism called ‘trait objects’. -### Dynamically Sized Type +### Dynamically sized type A dynamically sized type (DST) is a type without a statically known size or alignment. @@ -59,18 +60,33 @@ and functions that evaluate to a single value, with or without side-effects. For example, `2 + (3 * 4)` is an expression that returns the value 14. +### Free item + +An [item] that is not a member of an [implementation], such as a *free +function* or a *free const*. Contrast to an [associated item]. + +### Inherent implementation + +An [implementation] that applies to a nominal type, not to a trait-type pair. +[More][inherent implementation]. + +### Inherent method + +A [method] defined in an [inherent implementation], not in a trait +implementation. + ### Initialized A variable is initialized if it has been assigned a value and hasn't since been -moved from. All other memory locations are assumed to be initialized. Only +moved from. All other memory locations are assumed to be uninitialized. Only unsafe Rust can create such a memory without initializing it. -### Nominal Types +### Nominal types Types that can be referred to by a path directly. Specifically [enums], [structs], [unions], and [trait objects]. -### Object Safe Traits +### Object safe traits [Traits] that can be used as [trait objects]. Only traits that follow specific [rules][object safety] are object safe. @@ -136,11 +152,25 @@ It allows a type to make certain promises about its behavior. Generic functions and generic structs can use traits to constrain, or bound, the types they accept. +### Undefined behavior + +Compile-time or run-time behavior that is not specified. This may result in, +but is not limited to: process termination or corruption; improper, incorrect, +or unintended computation; or platform-specific results. +[More][undefined-behavior]. + [alignment]: type-layout.html#size-and-alignment +[associated item]: #associated-item [enums]: items/enumerations.html +[free item]: #free-item +[function]: items/functions.html +[implementation]: items/implementations.html +[implementations]: items/implementations.html +[inherent implementation]: items/implementations.html#inherent-implementations +[item]: items.html +[method]: items/associated-items.html#methods +[object safety]: items/traits.html#object-safety [structs]: items/structs.html -[unions]: items/unions.html [trait objects]: types/trait-object.html -[implementations]: items/implementations.html [traits]: items/traits.html -[object safety]: items/traits.html#object-safety +[unions]: items/unions.html