Skip to content

Commit

Permalink
Add a new debug_assertions intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Feb 8, 2024
1 parent 580067c commit 55fabf3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2569,6 +2569,17 @@ extern "rust-intrinsic" {
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn is_val_statically_known<T: Copy>(arg: T) -> bool;

#[rustc_const_unstable(feature = "delayed_debug_assertions", issue = "none")]
#[rustc_safe_intrinsic]
#[cfg(not(bootstrap))]
pub(crate) fn debug_assertions() -> bool;
}

#[cfg(bootstrap)]
#[rustc_const_unstable(feature = "delayed_debug_assertions", issue = "none")]
pub(crate) const fn debug_assertions() -> bool {
cfg!(debug_assertions)
}

// FIXME: Seems using `unstable` here completely ignores `rustc_allow_const_fn_unstable`
Expand Down

0 comments on commit 55fabf3

Please sign in to comment.