Skip to content

Document that -C opt-level=0 implies -C debug-assertions more prominently #39449

Closed
@mystor

Description

@mystor

All I was able to find documenting this is an ambiguous mention in the rust reference:
https://github.com/rust-lang/rust/blob/17cae033787aca26b00a8c820c1599926a1fd94d/src/doc/reference.md#conditional-compilation

It would be nice if, for example, the documentation for std::debug_assert! was updated to mention:

Unlike assert!, debug_assert! statements are only enabled in non optimized builds by default. An optimized build will omit all debug_assert! statements unless -C debug-assertions or -C opt-level=0 is passed to the compiler. This makes debug_assert! useful for checks that are too expensive to be present in a release build but may be helpful during development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions