Skip to content

Commit 55fabf3

Browse files
committed
Add a new debug_assertions intrinsic
1 parent 580067c commit 55fabf3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

library/core/src/intrinsics.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2569,6 +2569,17 @@ extern "rust-intrinsic" {
25692569
#[rustc_nounwind]
25702570
#[cfg(not(bootstrap))]
25712571
pub fn is_val_statically_known<T: Copy>(arg: T) -> bool;
2572+
2573+
#[rustc_const_unstable(feature = "delayed_debug_assertions", issue = "none")]
2574+
#[rustc_safe_intrinsic]
2575+
#[cfg(not(bootstrap))]
2576+
pub(crate) fn debug_assertions() -> bool;
2577+
}
2578+
2579+
#[cfg(bootstrap)]
2580+
#[rustc_const_unstable(feature = "delayed_debug_assertions", issue = "none")]
2581+
pub(crate) const fn debug_assertions() -> bool {
2582+
cfg!(debug_assertions)
25722583
}
25732584

25742585
// FIXME: Seems using `unstable` here completely ignores `rustc_allow_const_fn_unstable`

0 commit comments

Comments
 (0)