1
1
# Glossary
2
2
3
- ### Abstract Syntax Tree
3
+ ### Abstract syntax tree
4
4
5
5
An ‘abstract syntax tree’, or ‘AST’, is an intermediate representation of
6
6
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
23
23
describing a collection of elements, each selected by an index that can be computed
24
24
at run time by the program. It occupies a contiguous region of memory.
25
25
26
- ### Associated Item
26
+ ### Associated item
27
27
28
28
An associated item is an item that is associated with another item. Associated
29
- items are defined in [ implementations] and declared in [ traits] . Only functions,
30
- constants, and type aliases can be associated.
29
+ items are defined in [ implementations] and declared in [ traits] . Only
30
+ functions, constants, and type aliases can be associated. Contrast to a [ free
31
+ item] .
31
32
32
33
### Bound
33
34
@@ -48,7 +49,7 @@ run when it involves polymorphism. Two major forms of dispatch are static dispat
48
49
dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch
49
50
through a mechanism called ‘trait objects’.
50
51
51
- ### Dynamically Sized Type
52
+ ### Dynamically sized type
52
53
53
54
A dynamically sized type (DST) is a type without a statically known size or alignment.
54
55
@@ -59,18 +60,33 @@ and functions that evaluate to a single value, with or without side-effects.
59
60
60
61
For example, ` 2 + (3 * 4) ` is an expression that returns the value 14.
61
62
63
+ ### Free item
64
+
65
+ An [ item] that is not a member of an [ implementation] , such as a * free
66
+ function* or a * free const* . Contrast to an [ associated item] .
67
+
68
+ ### Inherent implementation
69
+
70
+ An [ implementation] that applies to a nominal type, not to a trait-type pair.
71
+ [ More] [ inherent implementation ] .
72
+
73
+ ### Inherent method
74
+
75
+ A [ method] defined in an [ inherent implementation] , not in a trait
76
+ implementation.
77
+
62
78
### Initialized
63
79
64
80
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
81
+ moved from. All other memory locations are assumed to be uninitialized . Only
66
82
unsafe Rust can create such a memory without initializing it.
67
83
68
- ### Nominal Types
84
+ ### Nominal types
69
85
70
86
Types that can be referred to by a path directly. Specifically [ enums] ,
71
87
[ structs] , [ unions] , and [ trait objects] .
72
88
73
- ### Object Safe Traits
89
+ ### Object safe traits
74
90
75
91
[ Traits] that can be used as [ trait objects] . Only traits that follow specific
76
92
[ rules] [ object safety ] are object safe.
@@ -136,11 +152,25 @@ It allows a type to make certain promises about its behavior.
136
152
137
153
Generic functions and generic structs can use traits to constrain, or bound, the types they accept.
138
154
155
+ ### Undefined behavior
156
+
157
+ Compile-time or run-time behavior that is not specified. This may result in,
158
+ but is not limited to: process termination or corruption; improper, incorrect,
159
+ or unintended computation; or platform-specific results.
160
+ [ More] [ undefined-behavior ] .
161
+
139
162
[ alignment ] : type-layout.html#size-and-alignment
163
+ [ associated item ] : #associated-item
140
164
[ enums ] : items/enumerations.html
165
+ [ free item ] : #free-item
166
+ [ function ] : items/functions.html
167
+ [ implementation ] : items/implementations.html
168
+ [ implementations ] : items/implementations.html
169
+ [ inherent implementation ] : items/implementations.html#inherent-implementations
170
+ [ item ] : items.html
171
+ [ method ] : items/associated-items.html#methods
172
+ [ object safety ] : items/traits.html#object-safety
141
173
[ structs ] : items/structs.html
142
- [ unions ] : items/unions.html
143
174
[ trait objects ] : types/trait-object.html
144
- [ implementations ] : items/implementations.html
145
175
[ traits ] : items/traits.html
146
- [ object safety ] : items/traits .html#object-safety
176
+ [ unions ] : items/unions .html
0 commit comments