Skip to content

Commit

Permalink
cfg out the check in write
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Sep 1, 2024
1 parent deb9d38 commit 2986cc0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
// `dst` cannot overlap `src` because the caller has mutable access
// to `dst` while `src` is owned by this function.
unsafe {
#[cfg(debug_assertions)]
ub_checks::assert_unsafe_precondition!(
check_language_ub,
"ptr::write requires that the pointer argument is aligned and non-null",
Expand Down

0 comments on commit 2986cc0

Please sign in to comment.