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,7 +23,7 @@ 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
29
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
48
48
dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch
49
49
through a mechanism called ‘trait objects’.
50
50
51
- ### Dynamically Sized Type
51
+ ### Dynamically sized type
52
52
53
53
A dynamically sized type (DST) is a type without a statically known size or alignment.
54
54
@@ -59,18 +59,32 @@ and functions that evaluate to a single value, with or without side-effects.
59
59
60
60
For example, ` 2 + (3 * 4) ` is an expression that returns the value 14.
61
61
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
+
62
76
### Initialized
63
77
64
78
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
66
80
unsafe Rust can create such a memory without initializing it.
67
81
68
- ### Nominal Types
82
+ ### Nominal types
69
83
70
84
Types that can be referred to by a path directly. Specifically [ enums] ,
71
85
[ structs] , [ unions] , and [ trait objects] .
72
86
73
- ### Object Safe Traits
87
+ ### Object safe traits
74
88
75
89
[ Traits] that can be used as [ trait objects] . Only traits that follow specific
76
90
[ rules] [ object safety ] are object safe.
@@ -136,11 +150,22 @@ It allows a type to make certain promises about its behavior.
136
150
137
151
Generic functions and generic structs can use traits to constrain, or bound, the types they accept.
138
152
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
+
139
160
[ alignment ] : type-layout.html#size-and-alignment
140
161
[ 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
141
168
[ structs ] : items/structs.html
142
- [ unions ] : items/unions.html
143
169
[ trait objects ] : types/trait-object.html
144
- [ implementations ] : items/implementations.html
145
170
[ traits ] : items/traits.html
146
- [ object safety ] : items/traits .html#object-safety
171
+ [ unions ] : items/unions .html
0 commit comments