]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #22980 - alexcrichton:debug-assertions, r=pnkfelix
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 6 Mar 2015 03:28:30 +0000 (08:58 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 6 Mar 2015 03:28:30 +0000 (08:58 +0530)
 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]

1  2 
src/libcore/macros.rs
src/librustc_trans/trans/base.rs

Simple merge
Simple merge