Closed
Description
An enhancement request discussed here:
https://users.rust-lang.org/t/detecting-overflow-checks/67698/
(That thread also contains a hacky solution by Yandros).
I propose to add a config like this:
#[cfg(overflow_checks)]
I would like to use it to enable/disable lines of code that perform safe unsafe "as" casts replacing them with casts when I compile with debug builds or with release builds compiled with "-C overflow-checks".
Activity
leonardo-m commentedon Nov 22, 2021
@rustbot modify labels: C-enhancement
hkratz commentedon Nov 25, 2021
@rustbot label A-attributes T-compiler
schuelermine commentedon Mar 22, 2023
I’d also be interested in this.
cfg(overflow_checks)
#111096AngelicosPhosphoros commentedon May 11, 2023
Tracking issue: #111466
Add support for `cfg(overflow_checks)`
Rollup merge of rust-lang#111096 - AngelicosPhosphoros:overflow_check…
overflow_checks
is enabled recmo/uint#408