Skip to content

Commit

Permalink
added c-like enums and patterns to const context list
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jul 31, 2015
1 parent 8107908 commit 1354de7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion text/0000-compile-time-asserts.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ insert an unconditional runtime-panic and issue a warning.

# Definition of constant evaluation context

There are exactly three places where an expression needs to be constant.
There are exactly five places where an expression needs to be constant.

- the initializer of a constant `const foo: ty = EXPR` or `static foo: ty = EXPR`
- the size of an array `[T; EXPR]`
- the length of a repeat expression `[VAL; LEN_EXPR]`
- C-Like enum variant discriminant values
- patterns

In the future the body of `const fn` might also be interpreted as a constant
evaluation context.
Expand Down

0 comments on commit 1354de7

Please sign in to comment.