Skip to content

Commit

Permalink
Clean up E0744 explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 2, 2020
1 parent 3a92b99 commit 093e45d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustc_error_codes/error_codes/E0744.md
@@ -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

0 comments on commit 093e45d

Please sign in to comment.