Closed
Description
cargo currently passes -g
when debugging is on and --cfg ndebug
when debugging is off:
if profile.debug() {
cmd.arg("-g");
} else {
cmd.args(&["--cfg", "ndebug"]);
}
The rust compiler recently stopped using --cfg ndebug
to control debug_assert!
and instead uses #[cfg(debug_assertions)]
, enabled when the optimization-level is 0, and overridable using -C debug-assertions
(RFC 563)
We may want to add a debug_assertions
profile setting like the existing opt-level
and debug
settings. Even if we don't, though, we should at least stop passing --cfg ndebug
.