You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using while in const fn results in a misleading error message on stable #61508
When while is used in a const fn on stable, it produces an error message: `if`, `match`, `&&` and `||` are not stable in const fn. This is a bit confusing because the function does not explicitly contain if, match, &&, or ||.
I would expect the error message to also mention that while is disallowed, or say that "loops are not allowed in const fn" (which it does when loop {} construct is encountered).
(It seems like it would be even better to have a specific error message for the disallowed construct that the compiler encounters rather than just providing a list of disallowed constructs, if this is possible architecturally.)
Activity
Rollup merge of rust-lang#61518 - czipperz:const-fn-doc-disallow-loop…