Skip to content

Commit

Permalink
Auto merge of rust-lang#62823 - RalfJung:miri, r=oli-obk
Browse files Browse the repository at this point in the history
update Miri

Fixes rust-lang#62802

r? @oli-obk @eddyb
  • Loading branch information
bors committed Jul 23, 2019
2 parents 3ebca72 + 10f877b commit 299ef86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,7 @@ pub(crate) fn is_aligned_and_not_null<T>(ptr: *const T) -> bool {

/// Checks whether the regions of memory starting at `src` and `dst` of size
/// `count * size_of::<T>()` overlap.
#[cfg(not(miri))] // Cannot compare with `>` across allocations in Miri
fn overlaps<T>(src: *const T, dst: *const T, count: usize) -> bool {
let src_usize = src as usize;
let dst_usize = dst as usize;
Expand Down Expand Up @@ -1437,6 +1438,7 @@ pub unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {

debug_assert!(is_aligned_and_not_null(src), "attempt to copy from unaligned or null pointer");
debug_assert!(is_aligned_and_not_null(dst), "attempt to copy to unaligned or null pointer");
#[cfg(not(miri))]
debug_assert!(!overlaps(src, dst, count), "attempt to copy to overlapping memory");
copy_nonoverlapping(src, dst, count)
}
Expand Down

0 comments on commit 299ef86

Please sign in to comment.