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
`{ const _PROMOTED = &EXPR; EXPR}`, but only if `EXPR` qualifies.
8
8
9
9
Note that promotion happens on the MIR, not on surface-level syntax. This is
10
10
relevant when discussing e.g. handling of panics caused by overflowing
11
11
arithmetic.
12
12
13
13
On top of what applies to [consts](const.md), promoteds suffer from the additional issue that *the user did not ask for them to be evaluated at compile-time*.
14
14
Thus, if CTFE fails but the code would have worked fine at run-time, we broke the user's code for no good reason.
15
+
Even if we are sure we found an error in the user's code, we are only allowed to [emit a warning, not a hard error][warn-rfc].
15
16
That's why we have to be very conservative with what can and cannot be promoted.
0 commit comments