Apply deny(unsafe_op_in_unsafe_fn) to all of sys/unsupported.
This commit is contained in:
parent
3d192ace34
commit
f4e884288d
4 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
pub mod alloc;
|
||||
pub mod args;
|
||||
pub mod cmath;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
use crate::cell::Cell;
|
||||
|
||||
pub struct Mutex {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
use crate::cell::Cell;
|
||||
|
||||
pub struct RWLock {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue