fix(build-rs)!: Remove meaningless 'cargo_cfg_debug_assertions'

The documentation that was added was pulled straight from a comment in
`custom_build.rs`.
This commit is contained in:
Ed Page 2024-12-06 09:27:38 -06:00
parent 70a6f011a4
commit 71f68dc3c3
2 changed files with 5 additions and 1 deletions

View File

@ -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")]

View File

@ -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")