Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add const generic args to const contexts. #995

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/const_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ A _const context_ is one of the following:
* [constants]
* [statics]
* [enum discriminants]
* A [const generic argument]

## Const Functions

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

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

* Use of generic parameters.
* Use of generic type and lifetime parameters.
* Const contexts do allow limited use of [const generic parameters].

[arithmetic]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
[array expressions]: expressions/array-expr.md
Expand All @@ -111,6 +113,8 @@ Conversely, the following are possible in a const function, but not in a const c
[closure expressions]: expressions/closure-expr.md
[comparison]: expressions/operator-expr.md#comparison-operators
[const functions]: items/functions.md#const-functions
[const generic argument]: items/generics.md#const-generics
[const generic parameters]: items/generics.md#const-generics
[constants]: items/constant-items.md
[Const parameters]: items/generics.md
[dereference operator]: expressions/operator-expr.md#the-dereference-operator
Expand Down