Didn't realize -O does not turn on NDEBUG. Moreover, the config switch to build libraries witout debugging assertions on is pretty well hidden and we don't distribute anything with it. Feels like there's a use case for building with -O and asserts on, but seems to be rarer than with -O and asserts off. IF you're optimizing, you're already dropping debuggability for perf and most people want to go the whole way. Requiring CFG_DISABLE_DEBUG=1 make is hard. Worse, overflow only enabled with --cfg NDEBUG. So it's gonna be a huge gotcha for benchmarks, etc. I feel that -O should imply --cfg NDEBUG by default.
I presume these are optimisations for building general Rust code, as opposed to specifically compiler code or some such?
May I request that building with at least minimal optimisations as well as most debug assertions (possibly not overflow checks) is possible? It sounds like this should still be possible; just wanted to check. (The use case is for tests which are slow to run, not for actual debugging.)