-C debug-assertions=off
does not apply on all consteval cases
#113122
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-discussion
Category: Discussion or questions that doesn't represent real issues.
When experimenting turning off optimizations for MIR output, for example, disabling
debug-assertions
in the following code, the output is confusing. The overflow checking is removed from functionfoo
, but not fromconst A
evaluation.It is less confusing if the debug assertions are turned off in all places.
BTW, is there a way to turn off
const-eval
?-Zmir-opt-level=0
is not useful.I tried this code:
Emitted mir for the code using
with rustc version
I expected to see the
CheckedAdd
replaced byAdd
and the assertion removed in the following code:The text was updated successfully, but these errors were encountered: