🔬This is a nightly-only experimental API. (
ub_checks
)Expand description
Provides the assert_unsafe_precondition
macro as well as some utility functions that cover
common preconditions.
Macros§
- assert_
unsafe_ precondition Experimental Checks that the preconditions of an unsafe function are followed.
Functions§
- check_
library_ ub Experimental Returns whether we should perform some UB-checking at runtime. This eventually evaluates tocfg!(ub_checks)
, but behaves different fromcfg!
when mixing crates built with different flags: if the crate has UB checks enabled or carries the#[rustc_preserve_ub_checks]
attribute, evaluation is delayed until monomorphization (or until the call gets inlined into a crate that does not delay evaluation further); otherwise it can happen any time.