From c5a29f92450c5d1191754000d37611af5e19f38b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 30 Jul 2021 00:33:30 +0200 Subject: [PATCH] Update error code description --- .../rustc_error_codes/src/error_codes/E0744.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0744.md b/compiler/rustc_error_codes/src/error_codes/E0744.md index 45804ab266e28..9a8ef3b840dff 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0744.md +++ b/compiler/rustc_error_codes/src/error_codes/E0744.md @@ -2,25 +2,15 @@ An unsupported expression was used inside a const context. Erroneous code example: -```compile_fail,E0744 +```compile_fail,edition2018,E0744 const _: i32 = { - let mut x = 0; - - for i in 0..4 { // error! - x += i; - } + async { 0 }.await }; ``` -At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden -inside a `const`, `static`, or `const fn`. +At the moment, `.await` is forbidden inside a `const`, `static`, or `const fn`. This may be allowed at some point in the future, but the implementation is not -yet complete. See the tracking issues for [`async`] and [`?`] in `const fn`, and -(to support `for` loops in `const fn`) the tracking issues for [`impl const -Trait for Ty`] and [`&mut T`] in `const fn`. +yet complete. See the tracking issue for [`async`] in `const fn`. [`async`]: https://github.com/rust-lang/rust/issues/69431 -[`?`]: https://github.com/rust-lang/rust/issues/74935 -[`impl const Trait for Ty`]: https://github.com/rust-lang/rust/issues/67792 -[`&mut T`]: https://github.com/rust-lang/rust/issues/57349