Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ndebug and replace with compiler flags (RFC 563) #22492

Closed
nikomatsakis opened this issue Feb 18, 2015 · 7 comments · Fixed by #22980
Closed

Remove ndebug and replace with compiler flags (RFC 563) #22492

nikomatsakis opened this issue Feb 18, 2015 · 7 comments · Fixed by #22980
Assignees
Milestone

Comments

@nikomatsakis
Copy link
Contributor

Tracking issue for rust-lang/rfcs#563.

Nominating.

@pnkfelix
Copy link
Member

P-backcompat-lang, 1.0 beta.

@pnkfelix pnkfelix added this to the 1.0 beta milestone Feb 26, 2015
@nikomatsakis
Copy link
Contributor Author

We have to figure out who is going to implement this.

cc @Aatch @alexcrichton @brson @huonw -- you guys seem like likely candidates and/or had strong opinions on the RFC thread, are any of you interested?

@alexcrichton
Copy link
Member

I can implement this.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 4, 2015
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.

Closes rust-lang#22492
[breaking-change]
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 4, 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.

Closes rust-lang#22492
[breaking-change]
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 5, 2015
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.

Closes rust-lang#22492
[breaking-change]
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 6, 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.

Closes rust-lang#22492
[breaking-change]
@rprichard
Copy link
Contributor

Cargo has a profile setting, "debug = false", that passes --cfg ndebug to rustc. Link to code. Should this be changed to --cfg debug_assertions?

@rprichard
Copy link
Contributor

Cargo has a profile setting, "debug = false", that passes --cfg ndebug to rustc. Link to code. Should this be changed to --cfg debug_assertions?

This specific change is probably wrong, but maybe Cargo should not be passing --cfg ndebug anymore.

@alexcrichton
Copy link
Member

Yes I think cargo needs to grow support for this specific option as well, can you open a bug in the Cargo repo for this feature?

@rprichard
Copy link
Contributor

I filed this issue, rust-lang/cargo#1398.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants