Skip to content

Commit

Permalink
Fix docs and tracking issue number for ub_checks
Browse files Browse the repository at this point in the history
* Change `ub_checks` unstable feature issue from "none" to "123499".
* Change `assert_unsafe_precondition` docs to refer to `check_language_ub`.
  • Loading branch information
ChaiTRex committed Aug 21, 2024
1 parent 982c6f8 commit dd76868
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub mod hint;
pub mod intrinsics;
pub mod mem;
pub mod ptr;
#[unstable(feature = "ub_checks", issue = "none")]
#[unstable(feature = "ub_checks", issue = "123499")]
pub mod ub_checks;

/* Core language traits */
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/ub_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::intrinsics::{self, const_eval_select};
/// macro for language UB are always ignored.
///
/// This macro should be called as
/// `assert_unsafe_precondition!(check_{library,lang}_ub, "message", (ident: type = expr, ident: type = expr) => check_expr)`
/// `assert_unsafe_precondition!(check_{library,language}_ub, "message", (ident: type = expr, ident: type = expr) => check_expr)`
/// where each `expr` will be evaluated and passed in as function argument `ident: type`. Then all
/// those arguments are passed to a function with the body `check_expr`.
/// Pick `check_language_ub` when this is guarding a violation of language UB, i.e., immediate UB
Expand Down Expand Up @@ -49,7 +49,7 @@ use crate::intrinsics::{self, const_eval_select};
/// debuginfo to have a measurable compile-time impact on debug builds.
#[allow_internal_unstable(const_ub_checks)] // permit this to be called in stably-const fn
#[macro_export]
#[unstable(feature = "ub_checks", issue = "none")]
#[unstable(feature = "ub_checks", issue = "123499")]
macro_rules! assert_unsafe_precondition {
($kind:ident, $message:expr, ($($name:ident:$ty:ty = $arg:expr),*$(,)?) => $e:expr $(,)?) => {
{
Expand Down Expand Up @@ -79,11 +79,11 @@ macro_rules! assert_unsafe_precondition {
}
};
}
#[unstable(feature = "ub_checks", issue = "none")]
#[unstable(feature = "ub_checks", issue = "123499")]
pub use assert_unsafe_precondition;
/// Checking library UB is always enabled when UB-checking is done
/// (and we use a reexport so that there is no unnecessary wrapper function).
#[unstable(feature = "ub_checks", issue = "none")]
#[unstable(feature = "ub_checks", issue = "123499")]
pub use intrinsics::ub_checks as check_library_ub;

/// Determines whether we should check for language UB.
Expand Down

0 comments on commit dd76868

Please sign in to comment.