Skip to content

Commit f1c75b7

Browse files
committed
Add some terms to the glossary.
1 parent c207931 commit f1c75b7

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

src/glossary.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Glossary
22

3-
### Abstract Syntax Tree
3+
### Abstract syntax tree
44

55
An ‘abstract syntax tree’, or ‘AST’, is an intermediate representation of
66
the structure of the program when the compiler is compiling it.
@@ -23,7 +23,7 @@ An array, sometimes also called a fixed-size array or an inline array, is a valu
2323
describing a collection of elements, each selected by an index that can be computed
2424
at run time by the program. It occupies a contiguous region of memory.
2525

26-
### Associated Item
26+
### Associated item
2727

2828
An associated item is an item that is associated with another item. Associated
2929
items are defined in [implementations] and declared in [traits]. Only functions,
@@ -48,7 +48,7 @@ run when it involves polymorphism. Two major forms of dispatch are static dispat
4848
dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch
4949
through a mechanism called ‘trait objects’.
5050

51-
### Dynamically Sized Type
51+
### Dynamically sized type
5252

5353
A dynamically sized type (DST) is a type without a statically known size or alignment.
5454

@@ -59,18 +59,32 @@ and functions that evaluate to a single value, with or without side-effects.
5959

6060
For example, `2 + (3 * 4)` is an expression that returns the value 14.
6161

62+
### Free function
63+
64+
A [function] that is not a member of an [implementation].
65+
66+
### Inherent implementation
67+
68+
An [implementation] that applies to a nominal type, not to a trait.
69+
[More][inherent implementation].
70+
71+
### Inherent method
72+
73+
A [method] defined in an [inherent implementation], not in a trait
74+
implementation.
75+
6276
### Initialized
6377

6478
A variable is initialized if it has been assigned a value and hasn't since been
65-
moved from. All other memory locations are assumed to be initialized. Only
79+
moved from. All other memory locations are assumed to be uninitialized. Only
6680
unsafe Rust can create such a memory without initializing it.
6781

68-
### Nominal Types
82+
### Nominal types
6983

7084
Types that can be referred to by a path directly. Specifically [enums],
7185
[structs], [unions], and [trait objects].
7286

73-
### Object Safe Traits
87+
### Object safe traits
7488

7589
[Traits] that can be used as [trait objects]. Only traits that follow specific
7690
[rules][object safety] are object safe.
@@ -136,11 +150,22 @@ It allows a type to make certain promises about its behavior.
136150

137151
Generic functions and generic structs can use traits to constrain, or bound, the types they accept.
138152

153+
### Undefined behavior
154+
155+
Compile-time or run-time behavior that is not specified. This may result in,
156+
but is not limited to: process termination or corruption; improper, incorrect,
157+
or unintended computation; or platform-specific results.
158+
[More][undefined-behavior].
159+
139160
[alignment]: type-layout.html#size-and-alignment
140161
[enums]: items/enumerations.html
162+
[function]: items/functions.html
163+
[implementation]: items/implementations.html
164+
[implementations]: items/implementations.html
165+
[inherent implementation]: items/implementations.html#inherent-implementations
166+
[method]: items/associated-items.html#methods
167+
[object safety]: items/traits.html#object-safety
141168
[structs]: items/structs.html
142-
[unions]: items/unions.html
143169
[trait objects]: types/trait-object.html
144-
[implementations]: items/implementations.html
145170
[traits]: items/traits.html
146-
[object safety]: items/traits.html#object-safety
171+
[unions]: items/unions.html

0 commit comments

Comments
 (0)