Skip to content

Commit d4cc6d8

Browse files
authored
Rollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire
Clean up E0744 explanation r? @Dylan-DPC
2 parents e728848 + 093e45d commit d4cc6d8

File tree

1 file changed

+5
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+5
-3
lines changed

src/librustc_error_codes/error_codes/E0744.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
Control-flow expressions are not allowed inside a const context.
1+
A control-flow expression was used inside a const context.
22

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

65
```compile_fail,E0744
76
const _: i32 = {
@@ -13,6 +12,9 @@ const _: i32 = {
1312
};
1413
```
1514

15+
At the moment, `if` and `match`, as well as the looping constructs `for`,
16+
`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`.
17+
1618
This will be allowed at some point in the future, but the implementation is not
1719
yet complete. See the tracking issue for [conditionals] or [loops] in a const
1820
context for the current status.

0 commit comments

Comments
 (0)