Skip to content

Commit

Permalink
Rollup merge of rust-lang#81166 - RalfJung:debug-assert-comments, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

remove some outdated comments regarding  debug assertions

rust-lang#79684 removed those debug assertions.
  • Loading branch information
GuillaumeGomez committed Jan 19, 2021
2 parents 2f1d5c4 + 712d065 commit 7aa3920
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ pub unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
pub const unsafe fn read<T>(src: *const T) -> T {
// `copy_nonoverlapping` takes care of debug_assert.
let mut tmp = MaybeUninit::<T>::uninit();
// SAFETY: the caller must guarantee that `src` is valid for reads.
// `src` cannot overlap `tmp` because `tmp` was just allocated on
Expand Down Expand Up @@ -787,7 +786,6 @@ pub const unsafe fn read<T>(src: *const T) -> T {
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
// `copy_nonoverlapping` takes care of debug_assert.
let mut tmp = MaybeUninit::<T>::uninit();
// SAFETY: the caller must guarantee that `src` is valid for reads.
// `src` cannot overlap `tmp` because `tmp` was just allocated on
Expand Down Expand Up @@ -988,7 +986,6 @@ pub unsafe fn write_unaligned<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 {
// `copy_nonoverlapping` takes care of debug_assert.
copy_nonoverlapping(&src as *const T as *const u8, dst as *mut u8, mem::size_of::<T>());
}
mem::forget(src);
Expand Down

0 comments on commit 7aa3920

Please sign in to comment.