@@ -30,6 +30,14 @@ items are defined in [implementations] and declared in [traits]. Only
30
30
functions, constants, and type aliases can be associated. Contrast to a [ free
31
31
item] .
32
32
33
+ ### Blanket implementation
34
+
35
+ Any implementation where a type appears [ uncovered] ( #uncovered-type ) . `impl<T > Foo
36
+ for T` , ` impl<T > Bar<T > for T` , ` impl<T > Bar<Vec<T >> for T` , and ` impl<T > Bar<T >
37
+ for Vec<T >` are considered blanket impls. However, ` impl<T > Bar<Vec<T >> for
38
+ Vec<T >` is not a blanket impl, as all instances of ` T` which appear in this ` impl`
39
+ are covered by ` Vec ` .
40
+
33
41
### Bound
34
42
35
43
Bounds are constraints on a type or trait. For example, if a bound
@@ -65,6 +73,21 @@ For example, `2 + (3 * 4)` is an expression that returns the value 14.
65
73
An [ item] that is not a member of an [ implementation] , such as a * free
66
74
function* or a * free const* . Contrast to an [ associated item] .
67
75
76
+ ### Fundamental traits
77
+
78
+ A fundamental trait is one where adding an impl of it for an existing type is a breaking change.
79
+ The ` Fn ` traits and ` Sized ` are fundamental.
80
+
81
+ ### Fundamental type constructors
82
+
83
+ A fundamental type constructor is a type where implementing a [ blanket implementation] ( #blanket-implementation ) over it
84
+ is a breaking change. ` & ` , ` &mut ` , ` Box ` , and ` Pin ` are fundamental.
85
+
86
+ Any time a type ` T ` is considered [ local] ( #local-type ) , ` &T ` , ` &mut T ` , ` Box<T> ` , and ` Pin<T> `
87
+ are also considered local. Fundamental type constructors cannot [ cover] ( #uncovered-type ) other types.
88
+ Any time the term "covered type" is used,
89
+ the ` T ` in ` &T ` , ` &mut T ` , ` Box<T> ` , and ` Pin<T> ` is not considered covered.
90
+
68
91
### Inhabited
69
92
70
93
A type is inhabited if it has constructors and therefore can be instantiated. An inhabited type is
@@ -87,6 +110,19 @@ A variable is initialized if it has been assigned a value and hasn't since been
87
110
moved from. All other memory locations are assumed to be uninitialized. Only
88
111
unsafe Rust can create such a memory without initializing it.
89
112
113
+ ### Local trait
114
+
115
+ A ` trait ` which was defined in the current crate. A trait definition is local
116
+ or not independent of applied type arguments. Given ` trait Foo<T, U> ` ,
117
+ ` Foo ` is always local, regardless of the types substituted for ` T ` and ` U ` .
118
+
119
+ ### Local type
120
+
121
+ A ` struct ` , ` enum ` , or ` union ` which was defined in the current crate.
122
+ This is not affected by applied type arguments. ` struct Foo ` is considered local, but
123
+ ` Vec<Foo> ` is not. ` LocalType<ForeignType> ` is local. Type aliases do not
124
+ affect locality.
125
+
90
126
### Nominal types
91
127
92
128
Types that can be referred to by a path directly. Specifically [ enums] ,
@@ -158,6 +194,12 @@ It allows a type to make certain promises about its behavior.
158
194
159
195
Generic functions and generic structs can use traits to constrain, or bound, the types they accept.
160
196
197
+ ### Uncovered type
198
+
199
+ A type which does not appear as an argument to another type. For example,
200
+ ` T ` is uncovered, but the ` T ` in ` Vec<T> ` is covered. This is only relevant for
201
+ type arguments.
202
+
161
203
### Undefined behavior
162
204
163
205
Compile-time or run-time behavior that is not specified. This may result in,
0 commit comments