Skip to content

Commit

Permalink
fix(build-rs)!: Remove meaningless 'cargo_cfg_debug_assertions'
Browse files Browse the repository at this point in the history
The documentation that was added was pulled straight from a comment in
`custom_build.rs`.
  • Loading branch information
epage committed Dec 6, 2024
1 parent 70a6f01 commit 71f68dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion crates/build-rs-test-lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fn smoke_test_inputs() {
use build_rs::input::*;
dbg!(cargo());
dbg!(cargo_cfg("careful"));
dbg!(cargo_cfg_debug_assertions());
#[cfg(feature = "unstable")]
dbg!(cargo_cfg_fmt_debug());
#[cfg(feature = "unstable")]
Expand Down
5 changes: 5 additions & 0 deletions crates/build-rs/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ mod cfg {
}

/// If we are compiling with debug assertions enabled.
///
/// Build scripts are not passed this cfg because
/// this cfg is always true and misleading.
/// That is because Cargo queries rustc without any profile settings.
#[cfg(any())]
#[track_caller]
pub fn cargo_cfg_debug_assertions() -> bool {
is_present("CARGO_CFG_DEBUG_ASSERTIONS")
Expand Down

0 comments on commit 71f68dc

Please sign in to comment.