@@ -9,7 +9,7 @@ can be evaluated at compile-time.
9
9
Certain forms of expressions, called constant expressions, can be evaluated at
10
10
compile time. In [ const contexts] ( #const-context ) , these are the only allowed
11
11
expressions, and are always evaluated at compile time. In other places, such as
12
- [ let statement ] s , constant expressions * may*
12
+ [ let statements ] , constant expressions * may*
13
13
be, but are not guaranteed to be, evaluated at compile time. Behaviors such as
14
14
out of bounds [ array indexing] or [ overflow] are compiler errors if the value
15
15
must be evaluated at compile time (i.e. in const contexts). Otherwise, these
@@ -20,19 +20,19 @@ also constant expressions and do not cause any [`Drop::drop`][destructors] calls
20
20
to be ran.
21
21
22
22
* [ Literals] .
23
- * [ Paths] to [ functions] ( items/functions.html ) and constants.
23
+ * [ Paths] to [ functions] and constants.
24
24
Recursively defining constants is not allowed.
25
25
* [ Tuple expressions] .
26
26
* [ Array expressions] .
27
27
* [ Struct] expressions.
28
28
* [ Enum variant] expressions.
29
29
* [ Block expressions] , including ` unsafe ` blocks.
30
- * [ let statement ] s and thus irrefutable [ patterns] , with the caveat that until ` if ` and ` match `
30
+ * [ let statements ] and thus irrefutable [ patterns] , with the caveat that until ` if ` and ` match `
31
31
are implemented, one cannot use both short circuiting operators (` && ` and ` || ` ) and let
32
32
statements within the same constant.
33
- * [ assignment expressions] ( operator-expr.html#assignment-expressions )
34
- * [ assignment operator expressions] ( operator-expr.html#compound-assignment-expressions )
35
- * [ expression statements] ( statements.html#expression-statements )
33
+ * [ assignment expressions]
34
+ * [ assignment operator expressions]
35
+ * [ expression statements]
36
36
* [ Field] expressions.
37
37
* Index expressions, [ array indexing] or [ slice] with a ` usize ` .
38
38
* [ Range expressions] .
@@ -57,34 +57,38 @@ A _const context_ is one of the following:
57
57
* [ statics]
58
58
* [ enum discriminants]
59
59
60
- [ array type length expressions ] : types/array.html
61
- [ enum discriminants ] : items/enumerations.html#custom-discriminant-values-for-field-less-enumerations
62
- [ constants ] : items/constant-items.html
63
- [ statics ] : items/static-items.html
64
- [ expressions ] : expressions.html
65
- [ array indexing ] : expressions/array-expr.html#array-and-slice-indexing-expressions
66
- [ overflow ] : expressions/operator-expr.html#overflow
67
- [ destructors ] : destructors.html
68
- [ literals ] : expressions/literal-expr.html
69
- [ paths ] : expressions/path-expr.html
70
- [ tuple expressions ] : expressions/tuple-expr.html
60
+ [ arithmetic, logical ] : expressions/operator-expr.html#arithmetic-and-logical-binary-operators
71
61
[ array expressions ] : expressions/array-expr.html
72
- [ struct ] : expressions/struct-expr.html
73
- [ enum variant ] : expressions/enum-variant-expr.html
74
- [ block expressions ] : expressions/block-expr.html
75
- [ field ] : expressions/field-expr.html
76
62
[ array indexing ] : expressions/array-expr.html#array-and-slice-indexing-expressions
77
- [ slice ] : types/slice.html
78
- [ range expressions ] : expressions/range-expr.html
63
+ [ array indexing ] : expressions/array-expr.html#array-and-slice-indexing-expressions
64
+ [ array type length expressions ] : types/array.html
65
+ [ assignment expressions ] : expressions/operator-expr.html#assignment-expressions
66
+ [ assignment operator expressions ] : expressions/operator-expr.html#compound-assignment-expressions
67
+ [ block expressions ] : expressions/block-expr.html
68
+ [ borrow ] : expressions/operator-expr.html#borrow-operators
69
+ [ cast ] : expressions/operator-expr.html#type-cast-expressions
79
70
[ closure expressions ] : expressions/closure-expr.html
80
- [ negation ] : expressions/operator-expr.html#negation-operators
81
- [ arithmetic, logical ] : expressions/operator-expr.html#arithmetic-and-logical-binary-operators
82
71
[ comparison ] : expressions/operator-expr.html#comparison-operators
83
- [ lazy boolean ] : expressions/operator-expr.html#lazy-boolean-operators
84
- [ borrow ] : expressions/operator-expr.html#borrow-operators
85
- [ interior mutability ] : interior-mutability.html
72
+ [ constants ] : items/constant-items.html
86
73
[ dereference operator ] : expressions/operator-expr.html#the-dereference-operator
74
+ [ destructors ] : destructors.html
75
+ [ enum discriminants ] : items/enumerations.html#custom-discriminant-values-for-field-less-enumerations
76
+ [ enum variant ] : expressions/enum-variant-expr.html
77
+ [ expression statements ] : statements.html#expression-statements
78
+ [ expressions ] : expressions.html
79
+ [ field ] : expressions/field-expr.html
80
+ [ functions ] : items/functions.html
87
81
[ grouped ] : expressions/grouped-expr.html
88
- [ cast ] : expressions/operator-expr.html#type-cast-expressions
89
- [ let statement ] : statements.html#let-statements
90
- [ patterns ] : patterns.html
82
+ [ interior mutability ] : interior-mutability.html
83
+ [ lazy boolean ] : expressions/operator-expr.html#lazy-boolean-operators
84
+ [ let statements ] : statements.html#let-statements
85
+ [ literals ] : expressions/literal-expr.html
86
+ [ negation ] : expressions/operator-expr.html#negation-operators
87
+ [ overflow ] : expressions/operator-expr.html#overflow
88
+ [ paths ] : expressions/path-expr.html
89
+ [ patterns ] : patterns.html
90
+ [ range expressions ] : expressions/range-expr.html
91
+ [ slice ] : types/slice.html
92
+ [ statics ] : items/static-items.html
93
+ [ struct ] : expressions/struct-expr.html
94
+ [ tuple expressions ] : expressions/tuple-expr.html
0 commit comments