Skip to content

Commit 4d0af07

Browse files
authored
Merge pull request #995 from ehuss/const-arg-const-context
Add const generic args to const contexts.
2 parents fd97729 + 8425f5b commit 4d0af07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/const_eval.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ A _const context_ is one of the following:
5959
* [constants]
6060
* [statics]
6161
* [enum discriminants]
62+
* A [const generic argument]
6263

6364
## Const Functions
6465

@@ -96,7 +97,8 @@ Notable features that const contexts have, but const fn haven't are:
9697

9798
Conversely, the following are possible in a const function, but not in a const context:
9899

99-
* Use of generic parameters.
100+
* Use of generic type and lifetime parameters.
101+
* Const contexts do allow limited use of [const generic parameters].
100102

101103
[arithmetic]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
102104
[array expressions]: expressions/array-expr.md
@@ -111,6 +113,8 @@ Conversely, the following are possible in a const function, but not in a const c
111113
[closure expressions]: expressions/closure-expr.md
112114
[comparison]: expressions/operator-expr.md#comparison-operators
113115
[const functions]: items/functions.md#const-functions
116+
[const generic argument]: items/generics.md#const-generics
117+
[const generic parameters]: items/generics.md#const-generics
114118
[constants]: items/constant-items.md
115119
[Const parameters]: items/generics.md
116120
[dereference operator]: expressions/operator-expr.md#the-dereference-operator

0 commit comments

Comments
 (0)