File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ to be run.
54
54
A _ const context_ is one of the following:
55
55
56
56
* [ Array type length expressions]
57
- * [ Array repeat expressions] [ array expressions ]
57
+ * [ Array repeat length expressions] [ array expressions ]
58
58
* The initializer of
59
59
* [ constants]
60
60
* [ statics]
Original file line number Diff line number Diff line change 7
7
A * constant item* is an optionally named _ [ constant value] _ which is not associated
8
8
with a specific memory location in the program. Constants are essentially inlined
9
9
wherever they are used, meaning that they are copied directly into the relevant
10
- context when used. This includes usage of constants from external crates.
11
- References to the same constant are not necessarily guaranteed to refer to the
12
- same memory address.
10
+ context when used. This includes usage of constants from external crates, and
11
+ non- [ ` Copy ` ] types. References to the same constant are not necessarily
12
+ guaranteed to refer to the same memory address.
13
13
14
14
Constants must be explicitly typed. The type must have a ` 'static ` lifetime: any
15
15
references in the initializer must have ` 'static ` lifetimes.
@@ -95,3 +95,4 @@ m!(const _: () = (););
95
95
[ underscore imports ] : use-declarations.md#underscore-imports
96
96
[ _Type_ ] : ../types.md#type-expressions
97
97
[ _Expression_ ] : ../expressions.md
98
+ [ `Copy` ] : ../special-types-and-traits.md#copy
You can’t perform that action at this time.
0 commit comments