Rollup merge of #32035 - ubsan:master, r=bluss

Just take out the `NOTE` and the `#[allow(improper_ctypes)]`
This commit is contained in:
Steve Klabnik 2016-03-04 14:17:29 -05:00
commit b99354f07f
1 changed files with 0 additions and 2 deletions

View File

@ -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)
}