Skip to content

Commit 7aa3920

Browse files
Rollup merge of #81166 - RalfJung:debug-assert-comments, r=Mark-Simulacrum
remove some outdated comments regarding debug assertions #79684 removed those debug assertions.
2 parents 2f1d5c4 + 712d065 commit 7aa3920

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Diff for: library/core/src/ptr/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ pub unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
687687
#[stable(feature = "rust1", since = "1.0.0")]
688688
#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
689689
pub const unsafe fn read<T>(src: *const T) -> T {
690-
// `copy_nonoverlapping` takes care of debug_assert.
691690
let mut tmp = MaybeUninit::<T>::uninit();
692691
// SAFETY: the caller must guarantee that `src` is valid for reads.
693692
// `src` cannot overlap `tmp` because `tmp` was just allocated on
@@ -787,7 +786,6 @@ pub const unsafe fn read<T>(src: *const T) -> T {
787786
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
788787
#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
789788
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
790-
// `copy_nonoverlapping` takes care of debug_assert.
791789
let mut tmp = MaybeUninit::<T>::uninit();
792790
// SAFETY: the caller must guarantee that `src` is valid for reads.
793791
// `src` cannot overlap `tmp` because `tmp` was just allocated on
@@ -988,7 +986,6 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
988986
// `dst` cannot overlap `src` because the caller has mutable access
989987
// to `dst` while `src` is owned by this function.
990988
unsafe {
991-
// `copy_nonoverlapping` takes care of debug_assert.
992989
copy_nonoverlapping(&src as *const T as *const u8, dst as *mut u8, mem::size_of::<T>());
993990
}
994991
mem::forget(src);

0 commit comments

Comments
 (0)