From: Manish Goregaokar Date: Fri, 6 Mar 2015 03:28:30 +0000 (+0530) Subject: Rollup merge of #22980 - alexcrichton:debug-assertions, r=pnkfelix X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=efb487b503d87f04448fc5e6f75038ca98b8670e;p=rust.git Rollup merge of #22980 - alexcrichton:debug-assertions, r=pnkfelix This commit is an implementation of [RFC 563][rfc] which adds a new `cfg(debug_assertions)` directive which is specially recognized and calculated by the compiler. The flag is turned off at any optimization level greater than 1 and may also be explicitly controlled through the `-C debug-assertions` flag. [rfc]: https://github.com/rust-lang/rfcs/pull/563 The `debug_assert!` and `debug_assert_eq!` macros now respect this instead of the `ndebug` variable and `ndebug` no longer holds any meaning to the standard library. Code which was previously relying on `not(ndebug)` to gate expensive code should be updated to rely on `debug_assertions` instead. Closes #22492 [breaking-change] --- efb487b503d87f04448fc5e6f75038ca98b8670e