diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index eef70c833113b..170499e6df86f 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -1887,7 +1887,7 @@ pub unsafe fn write_volatile(dst: *mut T, src: T) { #[safety::requires(a.is_power_of_two())] // If T is a ZST, then answer should either be 0 or usize::MAX #[safety::ensures(|result| - mem::size_of::() != 0 || (p.addr() % a == 0 && *result == 0) || (p.addr() % a != 0 && *result == usize::MAX) + mem::size_of::() != 0 || if p.addr() % a == 0 { *result == 0 } else { *result == usize::MAX}) )] #[safety::ensures(|result| { // If T is not a ZST and p can be aligned, then applying result as an offest should produce an aligned address