File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
compiler/rustc_error_codes/src/error_codes Expand file tree Collapse file tree 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.
22
33Erroneous code example:
44
5- ``` compile_fail,E0744
5+ ``` compile_fail,edition2018, E0744
66const _: 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
1813This 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
You can’t perform that action at this time.
0 commit comments