diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index ce17fd31fad21..97c1e7a4fc2ba 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -2718,8 +2718,7 @@ pub const fn is_val_statically_known(_arg: T) -> bool { #[requires(ub_checks::can_dereference(x) && ub_checks::can_write(x))] #[requires(ub_checks::can_dereference(y) && ub_checks::can_write(y))] #[requires(x.addr() != y.addr() || core::mem::size_of::() == 0)] -#[requires(x.addr() > y.addr() || (y.addr() >= x.addr() + core::mem::size_of::()))] -#[requires(x.addr() < y.addr() || (x.addr() >= y.addr() + core::mem::size_of::()))] +#[requires((x.addr() >= y.addr() + core::mem::size_of::()) || (y.addr() >= x.addr() + core::mem::size_of::()))] pub const unsafe fn typed_swap(x: *mut T, y: *mut T) { // SAFETY: The caller provided single non-overlapping items behind // pointers, so swapping them with `count: 1` is fine.