Skip to content

Commit c5a29f9

Browse files
Update error code description
1 parent 550948c commit c5a29f9

File tree

1 file changed

+4
-14
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+4
-14
lines changed

compiler/rustc_error_codes/src/error_codes/E0744.md

+4-14
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,15 @@ An unsupported expression was used inside a const context.
22

33
Erroneous code example:
44

5-
```compile_fail,E0744
5+
```compile_fail,edition2018,E0744
66
const _: i32 = {
7-
let mut x = 0;
8-
9-
for i in 0..4 { // error!
10-
x += i;
11-
}
7+
async { 0 }.await
128
};
139
```
1410

15-
At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden
16-
inside a `const`, `static`, or `const fn`.
11+
At the moment, `.await` is forbidden inside a `const`, `static`, or `const fn`.
1712

1813
This may be allowed at some point in the future, but the implementation is not
19-
yet complete. See the tracking issues for [`async`] and [`?`] in `const fn`, and
20-
(to support `for` loops in `const fn`) the tracking issues for [`impl const
21-
Trait for Ty`] and [`&mut T`] in `const fn`.
14+
yet complete. See the tracking issue for [`async`] in `const fn`.
2215

2316
[`async`]: https://github.com/rust-lang/rust/issues/69431
24-
[`?`]: https://github.com/rust-lang/rust/issues/74935
25-
[`impl const Trait for Ty`]: https://github.com/rust-lang/rust/issues/67792
26-
[`&mut T`]: https://github.com/rust-lang/rust/issues/57349

0 commit comments

Comments
 (0)