Skip to content

Commit 71f68dc

Browse files
committed
fix(build-rs)!: Remove meaningless 'cargo_cfg_debug_assertions'
The documentation that was added was pulled straight from a comment in `custom_build.rs`.
1 parent 70a6f01 commit 71f68dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/build-rs-test-lib/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ fn smoke_test_inputs() {
1010
use build_rs::input::*;
1111
dbg!(cargo());
1212
dbg!(cargo_cfg("careful"));
13-
dbg!(cargo_cfg_debug_assertions());
1413
#[cfg(feature = "unstable")]
1514
dbg!(cargo_cfg_fmt_debug());
1615
#[cfg(feature = "unstable")]

crates/build-rs/src/input.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ mod cfg {
109109
}
110110

111111
/// If we are compiling with debug assertions enabled.
112+
///
113+
/// Build scripts are not passed this cfg because
114+
/// this cfg is always true and misleading.
115+
/// That is because Cargo queries rustc without any profile settings.
116+
#[cfg(any())]
112117
#[track_caller]
113118
pub fn cargo_cfg_debug_assertions() -> bool {
114119
is_present("CARGO_CFG_DEBUG_ASSERTIONS")

0 commit comments

Comments
 (0)