Skip to content
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
8 changes: 5 additions & 3 deletions src/librustc_error_codes/error_codes/E0744.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Control-flow expressions are not allowed inside a const context.
A control-flow expression was used inside a const context.

At the moment, `if` and `match`, as well as the looping constructs `for`,
`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`.
Erroneous code example:

```compile_fail,E0744
const _: i32 = {
Expand All @@ -13,6 +12,9 @@ const _: i32 = {
};
```

At the moment, `if` and `match`, as well as the looping constructs `for`,
`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`.

This will be allowed at some point in the future, but the implementation is not
yet complete. See the tracking issue for [conditionals] or [loops] in a const
context for the current status.
Expand Down