Module ub_checks

Source
๐Ÿ”ฌ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.

Re-exportsยง

pub use assert_unsafe_precondition;Experimental
pub use intrinsics::ub_checks as check_library_ub;Experimental

Functionsยง

check_language_ub ๐Ÿ”’ Experimental
Determines whether we should check for language UB.
is_valid_allocation_size ๐Ÿ”’ Experimental
maybe_is_aligned_and_not_null ๐Ÿ”’ Experimental
Checks whether ptr is properly aligned with respect to the given alignment, and if is_zst == false, that ptr is not null.
maybe_is_nonoverlapping ๐Ÿ”’ Experimental
Checks whether the regions of memory starting at src and dst of size count * size do not overlap.