Skip to content

Commit 1354de7

Browse files
committed
added c-like enums and patterns to const context list
1 parent 8107908 commit 1354de7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

text/0000-compile-time-asserts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ insert an unconditional runtime-panic and issue a warning.
1111

1212
# Definition of constant evaluation context
1313

14-
There are exactly three places where an expression needs to be constant.
14+
There are exactly five places where an expression needs to be constant.
1515

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

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

0 commit comments

Comments
 (0)