We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44196af commit 452ab44Copy full SHA for 452ab44
library/core/src/str/pattern.rs
@@ -1962,7 +1962,7 @@ unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool {
1962
&& crate::ub_checks::same_allocation(y.as_ptr(), py)
1963
&& px.addr() >= x.addr()
1964
&& py.addr() >= y.addr()
1965
- && px as isize - x.as_ptr() as isize == (py as isize - y.as_ptr() as isize))]
+ && px.addr() - x.addr() == py.addr() - y.addr())]
1966
while px < pxend {
1967
let vx = (px as *const u32).read_unaligned();
1968
let vy = (py as *const u32).read_unaligned();
0 commit comments