Skip to content

Commit afae610

Browse files
Import core::ffi::c_int
1 parent c6af92d commit afae610

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler-builtins/src/mem/impls.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// this use. Of course this is not a guarantee that such use will work, it just means that this
1616
// crate doing wrapping pointer arithmetic with a method that must not wrap won't be the problem if
1717
// something does go wrong at runtime.
18+
use core::ffi::c_int;
1819
use core::intrinsics::likely;
1920

2021
const WORD_SIZE: usize = core::mem::size_of::<usize>();
@@ -384,13 +385,13 @@ pub unsafe fn set_bytes(mut s: *mut u8, c: u8, mut n: usize) {
384385
}
385386

386387
#[inline(always)]
387-
pub unsafe fn compare_bytes(s1: *const u8, s2: *const u8, n: usize) -> core::ffi::c_int {
388+
pub unsafe fn compare_bytes(s1: *const u8, s2: *const u8, n: usize) -> c_int {
388389
let mut i = 0;
389390
while i < n {
390391
let a = *s1.wrapping_add(i);
391392
let b = *s2.wrapping_add(i);
392393
if a != b {
393-
return core::ffi::c_int::from(a) - core::ffi::c_int::from(b);
394+
return c_int::from(a) - c_int::from(b);
394395
}
395396
i += 1;
396397
}

0 commit comments

Comments
 (0)