File tree 1 file changed +4
-14
lines changed
compiler/rustc_error_codes/src/error_codes
1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -2,25 +2,15 @@ An unsupported expression was used inside a const context.
2
2
3
3
Erroneous code example:
4
4
5
- ``` compile_fail,E0744
5
+ ``` compile_fail,edition2018, E0744
6
6
const _: i32 = {
7
- let mut x = 0;
8
-
9
- for i in 0..4 { // error!
10
- x += i;
11
- }
7
+ async { 0 }.await
12
8
};
13
9
```
14
10
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 ` .
17
12
18
13
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 ` .
22
15
23
16
[ `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
You can’t perform that action at this time.
0 commit comments