1 An unsupported expression was used inside a const context.
3 Erroneous code example:
9 for i in 0..4 { // error!
15 At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden
16 inside a `const`, `static`, or `const fn`.
18 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`.
23 [`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