Skip to content

Commit

Permalink
Rollup merge of rust-lang#32035 - ubsan:master, r=bluss
Browse files Browse the repository at this point in the history
Just take out the `NOTE` and the `#[allow(improper_ctypes)]`
  • Loading branch information
steveklabnik committed Mar 4, 2016
2 parents 1f0d928 + 633cd84 commit b99354f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit b99354f

Please sign in to comment.