@@ -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,13 @@ 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 Type
77
+
78
+ Includes ` & ` , ` &mut ` , ` Box ` and ` Pin ` . Any time a type ` T ` is
79
+ considered [ local] ( #local-type ) , ` &T ` , ` &mut T ` , ` Box<T> ` and ` Pin<T> ` are also considered local.
80
+ Fundamental types cannot [ cover] ( #uncovered-type ) other types. Any time the term "covered type" is
81
+ used, the ` T ` in ` &T ` , ` &mut T ` , ` Box<T> ` and ` Pin<T> ` is not considered covered.
82
+
68
83
### Inhabited
69
84
70
85
A type is inhabited if it has constructors and therefore can be instantiated. An inhabited type is
@@ -87,6 +102,19 @@ A variable is initialized if it has been assigned a value and hasn't since been
87
102
moved from. All other memory locations are assumed to be uninitialized. Only
88
103
unsafe Rust can create such a memory without initializing it.
89
104
105
+ ### Local Trait
106
+
107
+ A trait which was defined in the current crate. Whether a trait is
108
+ local or not has nothing to do with type parameters. Given ` trait Foo<T, U> ` ,
109
+ ` Foo ` is always local, regardless of the types used for ` T ` or ` U ` .
110
+
111
+ ### Local Type
112
+
113
+ A struct, enum, or union which was defined in the current crate.
114
+ This is not affected by type parameters. ` struct Foo ` is considered local, but
115
+ ` Vec<Foo> ` is not. ` LocalType<ForeignType> ` is local. Type aliases and trait
116
+ aliases do not affect locality.
117
+
90
118
### Nominal types
91
119
92
120
Types that can be referred to by a path directly. Specifically [ enums] ,
@@ -158,6 +186,12 @@ It allows a type to make certain promises about its behavior.
158
186
159
187
Generic functions and generic structs can use traits to constrain, or bound, the types they accept.
160
188
189
+ ### Uncovered Type
190
+
191
+ A type which does not appear as a parameter to another type. For example,
192
+ ` T ` is uncovered, but the ` T ` in ` Vec<T> ` is covered. This is only relevant for
193
+ type parameters.
194
+
161
195
### Undefined behavior
162
196
163
197
Compile-time or run-time behavior that is not specified. This may result in,
0 commit comments