Uh oh!
There was an error while loading. Please reload this page.
rustc: Add a debug_assertions #[cfg] directive - #22980
Conversation
rust-highfive
commented
Mar 2, 2015
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Mar 2, 2015
Note that this does not currently modify |
There was a problem hiding this comment.
Does ! $(call RUN,debug) work reliably cross-platform?
There was a problem hiding this comment.
Ah turns out there's already a FAIL macro, I'll use that.
1f412f4 to
c6be9fcComparealexcrichton
commented
Mar 3, 2015
Addressed @huonw's comments |
bors
commented
Mar 3, 2015
☔ The latest upstream changes (presumably #22971) made this pull request unmergeable. Please resolve the merge conflicts. |
230e64e to
1358c2cComparealexcrichton
commented
Mar 3, 2015
I have also hooked up the now-landed overflow checking to this as well. If I haven't finished running the full suite of tests yet but I will update them as they come in. r? @pnkfelix |
There was a problem hiding this comment.
hmm, how will you ever reach this line? If debug-assertion are on, won't the earlier debug_assert_eq fail? (And even if it were changed to succeed, wouldn't the subsequent non-debug asserts then fail?)
If your intent is to test the correct behavior of side-effects (or lack thereof) that occur within debug_assert and debug_assert_eq, I think you need to make separate tests.
pnkfelix
commented
Mar 3, 2015
@alexcrichton can you add a configure switch or something for turning on (I would not mind if |
pnkfelix
commented
Mar 3, 2015
Overall the PR looks fine; r=me if you:
|
1358c2c to
3b59058Comparealexcrichton
commented
Mar 3, 2015
I'm going to punt on the |
alexcrichton
commented
Mar 3, 2015
@bors: r=pnkfelix 3b59058 |
3b59058 to
eca6dacComparealexcrichton
commented
Mar 4, 2015
bors
commented
Mar 4, 2015
⌛ Testing commit eca6dac with merge 07e853c... |
bors
commented
Mar 4, 2015
⌛ Testing commit eca6dac with merge 34693d5... |
bors
commented
Mar 4, 2015
💔 Test failed - auto-linux-64-x-android-t |
alexcrichton
commented
Mar 4, 2015
@bors: retry On Tue, Mar 3, 2015 at 7:19 PM, bors notifications@github.com wrote:
|
bors
commented
Mar 4, 2015
⚡ Previous build results are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
bors
commented
Mar 4, 2015
⚡ Previous build results are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
bors
commented
Mar 4, 2015
💔 Test failed - auto-win-32-nopt-t |
alexcrichton
commented
Mar 4, 2015
@bors: retry |
…kfelix 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]: rust-lang/rfcs#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. Closesrust-lang#22492 [breaking-change]
bors
commented
Mar 5, 2015
⌛ Testing commit eca6dac with merge eb0a2a6... |
bors
commented
Mar 5, 2015
💔 Test failed - auto-mac-32-opt |
eca6dac to
5571d40Comparealexcrichton
commented
Mar 5, 2015
@bors: r=pnkfelix 5571d40 |
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]: rust-lang/rfcs#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. Closesrust-lang#22492 [breaking-change]
5571d40 to
d5d8345Comparealexcrichton
commented
Mar 5, 2015
…kfelix 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]: rust-lang/rfcs#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. Closesrust-lang#22492 [breaking-change]
The name of this directive changed in rust-lang/rust#22980.
The name of this directive changed in rust-lang/rust#22980. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6245) <!-- Reviewable:end -->
As of rust-lang#22980 only `cfg(debug_assertions)` is used in the standard library and rustc code.
As of rust-lang#22980 only `cfg(debug_assertions)` is used in the standard library and rustc code.
…ubeck:ndebug); r=SimonSapin The name of this directive changed in rust-lang/rust#22980. Source-Repo: https://github.com/servo/servo Source-Revision: c724444ccb85551b5a0a581d673875ec9bce3d1f
…ubeck:ndebug); r=SimonSapin The name of this directive changed in rust-lang/rust#22980. Source-Repo: https://github.com/servo/servo Source-Revision: c724444ccb85551b5a0a581d673875ec9bce3d1f UltraBlame original commit: 3a8011945dea13f95829d2b1721f3a2a85e73392
…ubeck:ndebug); r=SimonSapin The name of this directive changed in rust-lang/rust#22980. Source-Repo: https://github.com/servo/servo Source-Revision: c724444ccb85551b5a0a581d673875ec9bce3d1f UltraBlame original commit: 3a8011945dea13f95829d2b1721f3a2a85e73392
…ubeck:ndebug); r=SimonSapin The name of this directive changed in rust-lang/rust#22980. Source-Repo: https://github.com/servo/servo Source-Revision: c724444ccb85551b5a0a581d673875ec9bce3d1f UltraBlame original commit: 3a8011945dea13f95829d2b1721f3a2a85e73392
This commit is an implementation of RFC 563 which adds a new
cfg(debug_assertions)directive which is specially recognized and calculatedby the compiler. The flag is turned off at any optimization level greater than 1
and may also be explicitly controlled through the
-C debug-assertionsflag.
The
debug_assert!anddebug_assert_eq!macros now respect this instead ofthe
ndebugvariable andndebugno longer holds any meaning to the standardlibrary.
Code which was previously relying on
not(ndebug)to gate expensive code shouldbe updated to rely on
debug_assertionsinstead.Closes#22492
[breaking-change]