1
Fork 0

Apply deny(unsafe_op_in_unsafe_fn) to all of sys/unsupported.

This commit is contained in:
Mara Bos 2020-10-08 23:37:23 +02:00
parent 3d192ace34
commit f4e884288d
4 changed files with 10 additions and 9 deletions

View file

@ -39,10 +39,13 @@ pub fn hashmap_random_keys() -> (u64, u64) {
pub enum Void {}
pub unsafe fn strlen(mut s: *const c_char) -> usize {
let mut n = 0;
while *s != 0 {
n += 1;
s = s.offset(1);
// SAFETY: The caller must guarantee `s` points to a valid 0-terminated string.
unsafe {
let mut n = 0;
while *s != 0 {
n += 1;
s = s.offset(1);
}
n
}
return n;
}

View file

@ -1,3 +1,5 @@
#![deny(unsafe_op_in_unsafe_fn)]
pub mod alloc;
pub mod args;
pub mod cmath;

View file

@ -1,5 +1,3 @@
#![deny(unsafe_op_in_unsafe_fn)]
use crate::cell::Cell;
pub struct Mutex {

View file

@ -1,5 +1,3 @@
#![deny(unsafe_op_in_unsafe_fn)]
use crate::cell::Cell;
pub struct RWLock {