Skip to content

Commit 7acdcad

Browse files
authored
Merge pull request #547 from ehuss/glossary-impls
Add some terms to the glossary.
2 parents bc87a02 + 8fe1f82 commit 7acdcad

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

src/glossary.md

+41-11
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,11 +23,12 @@ 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
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].
3132

3233
### Bound
3334

@@ -48,7 +49,7 @@ run when it involves polymorphism. Two major forms of dispatch are static dispat
4849
dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch
4950
through a mechanism called ‘trait objects’.
5051

51-
### Dynamically Sized Type
52+
### Dynamically sized type
5253

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

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

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

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+
6278
### Initialized
6379

6480
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
6682
unsafe Rust can create such a memory without initializing it.
6783

68-
### Nominal Types
84+
### Nominal types
6985

7086
Types that can be referred to by a path directly. Specifically [enums],
7187
[structs], [unions], and [trait objects].
7288

73-
### Object Safe Traits
89+
### Object safe traits
7490

7591
[Traits] that can be used as [trait objects]. Only traits that follow specific
7692
[rules][object safety] are object safe.
@@ -136,11 +152,25 @@ It allows a type to make certain promises about its behavior.
136152

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

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+
139162
[alignment]: type-layout.html#size-and-alignment
163+
[associated item]: #associated-item
140164
[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
141173
[structs]: items/structs.html
142-
[unions]: items/unions.html
143174
[trait objects]: types/trait-object.html
144-
[implementations]: items/implementations.html
145175
[traits]: items/traits.html
146-
[object safety]: items/traits.html#object-safety
176+
[unions]: items/unions.html

0 commit comments

Comments
 (0)