From 633cd84821431e93a3e40f662cbe00ba21755811 Mon Sep 17 00:00:00 2001 From: ubsan Date: Thu, 3 Mar 2016 19:53:31 -0800 Subject: [PATCH] `usize` is now a proper ctype, so fix cmp_slice --- src/libcore/str/mod.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 4d367cfd432f9..14f189409be63 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1095,8 +1095,6 @@ fn eq_slice(a: &str, b: &str) -> bool { /// faster than comparing each byte in a loop. #[inline] unsafe fn cmp_slice(a: &str, b: &str, len: usize) -> i32 { - // NOTE: In theory n should be libc::size_t and not usize, but libc is not available here - #[allow(improper_ctypes)] extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; } memcmp(a.as_ptr() as *const i8, b.as_ptr() as *const i8, len) }