diff --git a/src/c_str.rs b/src/c_str.rs index 7bbf6ac6e0..62a7d29d44 100644 --- a/src/c_str.rs +++ b/src/c_str.rs @@ -1,8 +1,5 @@ //! Nul-terminated byte strings. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{marker::PhantomData, ptr::NonNull, str::Utf8Error}; use alloc::{ diff --git a/src/c_vec.rs b/src/c_vec.rs index 423586e9b9..6d67b58662 100644 --- a/src/c_vec.rs +++ b/src/c_vec.rs @@ -1,8 +1,5 @@ //! Equivalent of Rust's `Vec`, but using relibc's own allocator. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ io::{self, Write}, platform::{self, WriteByte, types::*}, diff --git a/src/header/arpa_inet/mod.rs b/src/header/arpa_inet/mod.rs index c4f7af841a..7fedfa2ad2 100644 --- a/src/header/arpa_inet/mod.rs +++ b/src/header/arpa_inet/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ ptr, slice, str::{self, FromStr}, diff --git a/src/header/assert/mod.rs b/src/header/assert/mod.rs index 068daf4c8d..fd4790cf87 100644 --- a/src/header/assert/mod.rs +++ b/src/header/assert/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::CStr, platform::types::{c_char, c_int}, diff --git a/src/header/crypt/mod.rs b/src/header/crypt/mod.rs index acc1ad5925..00c9bb23bb 100644 --- a/src/header/crypt/mod.rs +++ b/src/header/crypt/mod.rs @@ -2,9 +2,6 @@ //! //! Non-POSIX, see . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use ::scrypt::password_hash::{Salt, SaltString}; use alloc::{ ffi::CString, diff --git a/src/header/ctype/mod.rs b/src/header/ctype/mod.rs index 9f6cd192d5..cbe2f35548 100644 --- a/src/header/ctype/mod.rs +++ b/src/header/ctype/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - // TODO: *_l functions use crate::platform::types::c_int; diff --git a/src/header/dirent/mod.rs b/src/header/dirent/mod.rs index 1d2912d332..e9c5b8300c 100644 --- a/src/header/dirent/mod.rs +++ b/src/header/dirent/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{boxed::Box, vec::Vec}; use core::{mem, ptr, slice}; diff --git a/src/header/dl-tls/mod.rs b/src/header/dl-tls/mod.rs index eb338ac4be..f13dfff975 100644 --- a/src/header/dl-tls/mod.rs +++ b/src/header/dl-tls/mod.rs @@ -1,6 +1,5 @@ //! dl-tls implementation for Redox -#![deny(unsafe_op_in_unsafe_fn)] // FIXME(andypython): remove this when #![allow(warnings, unused_variables)] is // dropped from src/lib.rs. #![warn(warnings, unused_variables)] diff --git a/src/header/dlfcn/mod.rs b/src/header/dlfcn/mod.rs index 52b9bb43ef..118355b3f4 100644 --- a/src/header/dlfcn/mod.rs +++ b/src/header/dlfcn/mod.rs @@ -2,7 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] // FIXME(andypython): remove this when #![allow(warnings, unused_variables)] is // dropped from src/lib.rs. #![warn(warnings, unused_variables)] diff --git a/src/header/errno/mod.rs b/src/header/errno/mod.rs index 5ba60b1c99..6bc1451a61 100644 --- a/src/header/errno/mod.rs +++ b/src/header/errno/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::platform::{ self, types::{c_char, c_int}, diff --git a/src/header/fcntl/mod.rs b/src/header/fcntl/mod.rs index 81c7b2887d..6a4db2fafc 100644 --- a/src/header/fcntl/mod.rs +++ b/src/header/fcntl/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use core::num::NonZeroU64; use crate::{ diff --git a/src/header/float/mod.rs b/src/header/float/mod.rs index 52c36df8d8..e806f0ce91 100644 --- a/src/header/float/mod.rs +++ b/src/header/float/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::_fenv::{FE_TONEAREST, fegetround}, platform::types::c_int, diff --git a/src/header/fnmatch/mod.rs b/src/header/fnmatch/mod.rs index 2f45056482..60f6316d2c 100644 --- a/src/header/fnmatch/mod.rs +++ b/src/header/fnmatch/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{borrow::Cow, vec::Vec}; use core::slice; diff --git a/src/header/getopt/mod.rs b/src/header/getopt/mod.rs index f095753d30..062d17b6b2 100644 --- a/src/header/getopt/mod.rs +++ b/src/header/getopt/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{ stdio, string, diff --git a/src/header/glob/mod.rs b/src/header/glob/mod.rs index ff7995d0a1..4b6718445c 100644 --- a/src/header/glob/mod.rs +++ b/src/header/glob/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr; use alloc::{boxed::Box, vec::Vec}; diff --git a/src/header/grp/mod.rs b/src/header/grp/mod.rs index 73235dcf16..957d98ecc6 100644 --- a/src/header/grp/mod.rs +++ b/src/header/grp/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ cell::SyncUnsafeCell, convert::{TryFrom, TryInto}, diff --git a/src/header/ifaddrs/mod.rs b/src/header/ifaddrs/mod.rs index 5e59e8b9ad..f49a357358 100644 --- a/src/header/ifaddrs/mod.rs +++ b/src/header/ifaddrs/mod.rs @@ -1,8 +1,5 @@ //! `ifaddrs.h` implementation -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr; use crate::{ diff --git a/src/header/inttypes/mod.rs b/src/header/inttypes/mod.rs index 8678304f98..07943d3e5b 100644 --- a/src/header/inttypes/mod.rs +++ b/src/header/inttypes/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{ctype, errno::*, stdlib::*}, platform::{ diff --git a/src/header/libgen/mod.rs b/src/header/libgen/mod.rs index 4b174444eb..37d90d2def 100644 --- a/src/header/libgen/mod.rs +++ b/src/header/libgen/mod.rs @@ -2,8 +2,6 @@ //! //! See . -#![deny(unsafe_op_in_unsafe_fn)] - use crate::platform::types::c_char; use crate::header::string::strlen; diff --git a/src/header/locale/mod.rs b/src/header/locale/mod.rs index 0f135f11d2..0b55974077 100644 --- a/src/header/locale/mod.rs +++ b/src/header/locale/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{boxed::Box, ffi::CString, string::String}; use core::{ptr, str::FromStr}; diff --git a/src/header/malloc/mod.rs b/src/header/malloc/mod.rs index c3a04d930b..cc8ef5449b 100644 --- a/src/header/malloc/mod.rs +++ b/src/header/malloc/mod.rs @@ -2,9 +2,6 @@ //! //! Non-POSIX, see . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::errno::ENOMEM, platform::{ diff --git a/src/header/monetary/mod.rs b/src/header/monetary/mod.rs index 5c2f8cb9fb..1b1ca420cb 100644 --- a/src/header/monetary/mod.rs +++ b/src/header/monetary/mod.rs @@ -13,7 +13,6 @@ use libm::{fabs, floor, pow, round, trunc}; extern crate alloc; mod strfmon; -#[deny(unsafe_op_in_unsafe_fn)] #[repr(C)] struct LocaleMonetaryInfo { int_curr_symbol: &'static str, diff --git a/src/header/net_if/mod.rs b/src/header/net_if/mod.rs index beaf2f5a29..40c1ca32e2 100644 --- a/src/header/net_if/mod.rs +++ b/src/header/net_if/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr::null; use alloc::ffi::CString; diff --git a/src/header/netdb/host.rs b/src/header/netdb/host.rs index a9c30a6254..f78f39ab15 100644 --- a/src/header/netdb/host.rs +++ b/src/header/netdb/host.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{boxed::Box, str::SplitWhitespace, vec::Vec}; use core::{mem, ptr}; diff --git a/src/header/netdb/mod.rs b/src/header/netdb/mod.rs index 072cd64b11..b5ba54d1dd 100644 --- a/src/header/netdb/mod.rs +++ b/src/header/netdb/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - mod dns; use core::{ diff --git a/src/header/poll/mod.rs b/src/header/poll/mod.rs index 5f4326c293..bacebf84ef 100644 --- a/src/header/poll/mod.rs +++ b/src/header/poll/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{mem, ptr, slice}; use crate::{ diff --git a/src/header/pthread/attr.rs b/src/header/pthread/attr.rs index aa2329859e..7f31d14e94 100644 --- a/src/header/pthread/attr.rs +++ b/src/header/pthread/attr.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ptr, sync::atomic::Ordering}; use super::*; diff --git a/src/header/pthread/barrier.rs b/src/header/pthread/barrier.rs index f3618bf685..6bb66d74ca 100644 --- a/src/header/pthread/barrier.rs +++ b/src/header/pthread/barrier.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::header::errno::*; use core::num::NonZeroU32; diff --git a/src/header/pthread/cond.rs b/src/header/pthread/cond.rs index 7fda576d39..ab08b6cca5 100644 --- a/src/header/pthread/cond.rs +++ b/src/header/pthread/cond.rs @@ -1,8 +1,5 @@ // Used design from https://www.remlab.net/op/futex-condvar.shtml -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::header::time::CLOCK_REALTIME; use super::*; diff --git a/src/header/pthread/mod.rs b/src/header/pthread/mod.rs index eba998a6b1..e96504551d 100644 --- a/src/header/pthread/mod.rs +++ b/src/header/pthread/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::collections::LinkedList; use core::{cell::Cell, ptr::NonNull}; diff --git a/src/header/pthread/mutex.rs b/src/header/pthread/mutex.rs index c2d7becb7d..32daa1e937 100644 --- a/src/header/pthread/mutex.rs +++ b/src/header/pthread/mutex.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use super::*; use crate::{ diff --git a/src/header/pthread/once.rs b/src/header/pthread/once.rs index f13da472c4..76348bbcf6 100644 --- a/src/header/pthread/once.rs +++ b/src/header/pthread/once.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use super::*; // PTHREAD_ONCE_INIT diff --git a/src/header/pthread/rwlock.rs b/src/header/pthread/rwlock.rs index d29cd31515..e4682f067c 100644 --- a/src/header/pthread/rwlock.rs +++ b/src/header/pthread/rwlock.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use super::*; use crate::header::errno::EBUSY; diff --git a/src/header/pthread/spin.rs b/src/header/pthread/spin.rs index cef8da6035..094a9ea31b 100644 --- a/src/header/pthread/spin.rs +++ b/src/header/pthread/spin.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::sync::atomic::{AtomicI32 as AtomicInt, Ordering}; use crate::header::errno::EBUSY; diff --git a/src/header/pthread/tls.rs b/src/header/pthread/tls.rs index e0a0276c92..6ece3e9926 100644 --- a/src/header/pthread/tls.rs +++ b/src/header/pthread/tls.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use super::*; // TODO: Hashmap? diff --git a/src/header/pty/linux.rs b/src/header/pty/linux.rs index 1ad910ba5b..5c580d612d 100644 --- a/src/header/pty/linux.rs +++ b/src/header/pty/linux.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{fcntl, sys_ioctl, unistd}, io::{Cursor, Write}, diff --git a/src/header/pty/mod.rs b/src/header/pty/mod.rs index 376a8497dd..9589c4a536 100644 --- a/src/header/pty/mod.rs +++ b/src/header/pty/mod.rs @@ -2,9 +2,6 @@ //! //! Non-POSIX, see . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{mem, ptr, slice}; use crate::{ diff --git a/src/header/pwd/mod.rs b/src/header/pwd/mod.rs index 8d0a71a8ea..21fffe5519 100644 --- a/src/header/pwd/mod.rs +++ b/src/header/pwd/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{boxed::Box, vec::Vec}; use core::{ ops::{Deref, DerefMut}, diff --git a/src/header/regex/mod.rs b/src/header/regex/mod.rs index 9b4c37ffaa..e73ecb4830 100644 --- a/src/header/regex/mod.rs +++ b/src/header/regex/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::string::strlen, platform::types::{c_char, c_int, c_void, size_t}, diff --git a/src/header/semaphore/mod.rs b/src/header/semaphore/mod.rs index f9e3b1778e..0dcf2144b1 100644 --- a/src/header/semaphore/mod.rs +++ b/src/header/semaphore/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec}, platform::types::{c_char, c_int, c_long, c_uint, clockid_t}, diff --git a/src/header/shadow/mod.rs b/src/header/shadow/mod.rs index db4f514ff4..5f5ffa96dd 100644 --- a/src/header/shadow/mod.rs +++ b/src/header/shadow/mod.rs @@ -1,5 +1,3 @@ -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ cell::SyncUnsafeCell, convert::TryInto, diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs index e773350958..0b29c3b901 100644 --- a/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{arch::global_asm, mem, ptr}; use cbitset::BitSet; diff --git a/src/header/stdio/getdelim.rs b/src/header/stdio/getdelim.rs index 19be72bb11..fd9d3efd77 100644 --- a/src/header/stdio/getdelim.rs +++ b/src/header/stdio/getdelim.rs @@ -1,8 +1,5 @@ // https://pubs.opengroup.org/onlinepubs/9699919799/functions/getline.html -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{string::String, vec::Vec}; use core::{fmt::Write, intrinsics::unlikely, ops::Deref, ptr}; diff --git a/src/header/stdio/mod.rs b/src/header/stdio/mod.rs index a38dd2de72..0f04dee481 100644 --- a/src/header/stdio/mod.rs +++ b/src/header/stdio/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{ borrow::{Borrow, BorrowMut}, boxed::Box, diff --git a/src/header/stdio/printf.rs b/src/header/stdio/printf.rs index 0c9c1c86fe..833bf8ebbc 100644 --- a/src/header/stdio/printf.rs +++ b/src/header/stdio/printf.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - // TODO: reuse more code with the wide printf impl use crate::{ c_str::{self, CStr, NulStr}, diff --git a/src/header/stdlib/mod.rs b/src/header/stdlib/mod.rs index 3dd1dbf3d7..9633d03de1 100644 --- a/src/header/stdlib/mod.rs +++ b/src/header/stdlib/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{convert::TryFrom, intrinsics, iter, mem, ptr, slice}; use rand::{ Rng, SeedableRng, diff --git a/src/header/stdlib/random.rs b/src/header/stdlib/random.rs index e92fdbfb29..f72efc5a8d 100644 --- a/src/header/stdlib/random.rs +++ b/src/header/stdlib/random.rs @@ -1,9 +1,6 @@ //! Helper functions for random() and friends, see https://pubs.opengroup.org/onlinepubs/7908799/xsh/initstate.html // Ported from musl's implementation (src/prng/random.c) -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ platform::types::c_uint, sync::{Mutex, MutexGuard}, diff --git a/src/header/stdlib/sort.rs b/src/header/stdlib/sort.rs index c53f4b947f..e9a00652bb 100644 --- a/src/header/stdlib/sort.rs +++ b/src/header/stdlib/sort.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::platform::types::{c_char, c_int, c_void, size_t}; pub unsafe fn introsort( diff --git a/src/header/strings/mod.rs b/src/header/strings/mod.rs index 204e58bd40..ad1b4b9be4 100644 --- a/src/header/strings/mod.rs +++ b/src/header/strings/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ arch, iter::{once, zip}, diff --git a/src/header/sys_epoll/mod.rs b/src/header/sys_epoll/mod.rs index 16183b3852..ec29d409b9 100644 --- a/src/header/sys_epoll/mod.rs +++ b/src/header/sys_epoll/mod.rs @@ -1,8 +1,5 @@ //! sys/epoll.h implementation for Redox, following http://man7.org/linux/man-pages/man7/epoll.7.html -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr; use crate::{ diff --git a/src/header/sys_ioctl/linux.rs b/src/header/sys_ioctl/linux.rs index e67375449f..67d15c13e9 100644 --- a/src/header/sys_ioctl/linux.rs +++ b/src/header/sys_ioctl/linux.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::ResultExt, platform::{Sys, types::*}, diff --git a/src/header/sys_mman/mod.rs b/src/header/sys_mman/mod.rs index 8789673674..5415be294a 100644 --- a/src/header/sys_mman/mod.rs +++ b/src/header/sys_mman/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::{CStr, CString}, error::{Errno, ResultExt}, diff --git a/src/header/sys_ptrace/mod.rs b/src/header/sys_ptrace/mod.rs index 4e7053d0fd..6767789d70 100644 --- a/src/header/sys_ptrace/mod.rs +++ b/src/header/sys_ptrace/mod.rs @@ -1,8 +1,5 @@ //! ptrace compatibility layer for Redox OS -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::ResultExt, platform::{PalPtrace, Sys, types::*}, diff --git a/src/header/sys_random/mod.rs b/src/header/sys_random/mod.rs index f12f4b80a9..4d3f3f1198 100644 --- a/src/header/sys_random/mod.rs +++ b/src/header/sys_random/mod.rs @@ -2,9 +2,6 @@ //! //! Non-POSIX, see . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::slice; use crate::{ diff --git a/src/header/sys_resource/mod.rs b/src/header/sys_resource/mod.rs index 87e943f68d..d9259a7342 100644 --- a/src/header/sys_resource/mod.rs +++ b/src/header/sys_resource/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::ResultExt, header::sys_time::timeval, diff --git a/src/header/sys_select/mod.rs b/src/header/sys_select/mod.rs index b97707586b..69afb10670 100644 --- a/src/header/sys_select/mod.rs +++ b/src/header/sys_select/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::mem; use cbitset::BitSet; diff --git a/src/header/sys_socket/mod.rs b/src/header/sys_socket/mod.rs index 8a0222e686..a71b57ae5c 100644 --- a/src/header/sys_socket/mod.rs +++ b/src/header/sys_socket/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{mem, ptr}; use crate::{ diff --git a/src/header/sys_statvfs/mod.rs b/src/header/sys_statvfs/mod.rs index 61052e0ac7..a48d924311 100644 --- a/src/header/sys_statvfs/mod.rs +++ b/src/header/sys_statvfs/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::CStr, error::ResultExt, diff --git a/src/header/sys_syslog/mod.rs b/src/header/sys_syslog/mod.rs index dd436d4bbc..b75ebb2440 100644 --- a/src/header/sys_syslog/mod.rs +++ b/src/header/sys_syslog/mod.rs @@ -4,9 +4,6 @@ // Exported as both syslog.h and sys/syslog.h. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - #[cfg(target_os = "redox")] #[path = "redox.rs"] pub mod sys; diff --git a/src/header/sys_time/mod.rs b/src/header/sys_time/mod.rs index 3d6193996d..1de62a9da3 100644 --- a/src/header/sys_time/mod.rs +++ b/src/header/sys_time/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::CStr, error::ResultExt, diff --git a/src/header/sys_timeb/mod.rs b/src/header/sys_timeb/mod.rs index 8960ac3132..0abf94e490 100644 --- a/src/header/sys_timeb/mod.rs +++ b/src/header/sys_timeb/mod.rs @@ -7,9 +7,6 @@ //! Specifications Issue 6, and the entire `sys/timeb.h` header was removed in //! Issue 7. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr::NonNull; use crate::{ diff --git a/src/header/sys_uio/mod.rs b/src/header/sys_uio/mod.rs index 627f2a4ad1..ddd714ab17 100644 --- a/src/header/sys_uio/mod.rs +++ b/src/header/sys_uio/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::vec::Vec; use core::slice; diff --git a/src/header/sys_utsname/mod.rs b/src/header/sys_utsname/mod.rs index bde1633f7e..f9031c7b95 100644 --- a/src/header/sys_utsname/mod.rs +++ b/src/header/sys_utsname/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::ResultExt, out::Out, diff --git a/src/header/sys_wait/mod.rs b/src/header/sys_wait/mod.rs index adcb21d088..11f4bf2c64 100644 --- a/src/header/sys_wait/mod.rs +++ b/src/header/sys_wait/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::ResultExt, out::Out, diff --git a/src/header/termios/mod.rs b/src/header/termios/mod.rs index 358841c232..1615d2190d 100644 --- a/src/header/termios/mod.rs +++ b/src/header/termios/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{ errno, diff --git a/src/header/time/mod.rs b/src/header/time/mod.rs index 1bb0668b1b..cc058717be 100644 --- a/src/header/time/mod.rs +++ b/src/header/time/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::{CStr, CString}, error::{Errno, ResultExt}, diff --git a/src/header/time/strftime.rs b/src/header/time/strftime.rs index df647f0764..05ed15ae90 100644 --- a/src/header/time/strftime.rs +++ b/src/header/time/strftime.rs @@ -2,9 +2,6 @@ // // See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::string::String; use super::{get_offset, tm}; diff --git a/src/header/unistd/brk.rs b/src/header/unistd/brk.rs index 61ac540a70..24c9a7a7af 100644 --- a/src/header/unistd/brk.rs +++ b/src/header/unistd/brk.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr; use crate::{ diff --git a/src/header/unistd/getopt.rs b/src/header/unistd/getopt.rs index f3963c46c0..5240e429fa 100644 --- a/src/header/unistd/getopt.rs +++ b/src/header/unistd/getopt.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::ptr; use crate::{ diff --git a/src/header/unistd/mod.rs b/src/header/unistd/mod.rs index 9b05bbd7d3..861f373fa8 100644 --- a/src/header/unistd/mod.rs +++ b/src/header/unistd/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ convert::TryFrom, ffi::VaListImpl, diff --git a/src/header/utime/mod.rs b/src/header/utime/mod.rs index 0161773d50..97ce28bf51 100644 --- a/src/header/utime/mod.rs +++ b/src/header/utime/mod.rs @@ -5,9 +5,6 @@ //! The `utime.h` header was marked obsolescent in the Open Group Base //! Specifications Issue 7, and removed in Issue 8. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ c_str::CStr, error::ResultExt, diff --git a/src/header/utmp/mod.rs b/src/header/utmp/mod.rs index 6032fa6dc7..0b3dfdf555 100644 --- a/src/header/utmp/mod.rs +++ b/src/header/utmp/mod.rs @@ -2,9 +2,6 @@ //! //! Non-POSIX, see . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{sys_ioctl, unistd}, platform::types::{c_int, c_void}, diff --git a/src/header/wchar/mod.rs b/src/header/wchar/mod.rs index 32236b5e6d..c13079b7c8 100644 --- a/src/header/wchar/mod.rs +++ b/src/header/wchar/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{char, ffi::VaList as va_list, mem, ptr, slice, usize}; use crate::{ diff --git a/src/header/wchar/utf8.rs b/src/header/wchar/utf8.rs index 31d1a8aba3..f56a0b941b 100644 --- a/src/header/wchar/utf8.rs +++ b/src/header/wchar/utf8.rs @@ -1,9 +1,6 @@ //UTF implementation parts for wchar.h. //Partially ported from the Sortix libc -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{char, slice, str, usize}; use crate::{ diff --git a/src/header/wchar/wprintf.rs b/src/header/wchar/wprintf.rs index 539585dc2f..8e0d46b9c7 100644 --- a/src/header/wchar/wprintf.rs +++ b/src/header/wchar/wprintf.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - // TODO: reuse more code with the thin printf impl use crate::{ c_str::{self, WStr}, diff --git a/src/header/wchar/wscanf.rs b/src/header/wchar/wscanf.rs index e284a6631a..8edffd841a 100644 --- a/src/header/wchar/wscanf.rs +++ b/src/header/wchar/wscanf.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use super::lookaheadreader::LookAheadReader; use crate::platform::types::*; use alloc::{string::String, vec::Vec}; diff --git a/src/header/wctype/mod.rs b/src/header/wctype/mod.rs index 610017481d..999fd40ece 100644 --- a/src/header/wctype/mod.rs +++ b/src/header/wctype/mod.rs @@ -2,9 +2,6 @@ //! //! See . -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - // TODO: *_l functions use self::casecmp::casemap; diff --git a/src/io/buffered.rs b/src/io/buffered.rs index e0a5ab28da..c29c2e0a78 100644 --- a/src/io/buffered.rs +++ b/src/io/buffered.rs @@ -10,9 +10,6 @@ //! Buffering wrappers for I/O traits -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{cmp, fmt}; use crate::io::{ diff --git a/src/io/cursor.rs b/src/io/cursor.rs index ff229bd0ce..1ba0793106 100644 --- a/src/io/cursor.rs +++ b/src/io/cursor.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::cmp; use crate::io::{self, Error, ErrorKind, Initializer, SeekFrom, prelude::*}; diff --git a/src/io/impls.rs b/src/io/impls.rs index 2168bc80ce..29009efc42 100644 --- a/src/io/impls.rs +++ b/src/io/impls.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::string::String; use core::{cmp, fmt, mem}; diff --git a/src/io/mod.rs b/src/io/mod.rs index ae4f50ab3a..7f28d2b38c 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -267,9 +267,6 @@ //! [`Result`]: ../result/enum.Result.html //! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - pub mod buffered; pub mod cursor; pub mod error; diff --git a/src/ld_so/mod.rs b/src/ld_so/mod.rs index 12532e9c38..93231989cb 100644 --- a/src/ld_so/mod.rs +++ b/src/ld_so/mod.rs @@ -3,7 +3,6 @@ // FIXME(andypython): remove this when #![allow(warnings, unused_variables)] is // dropped from src/lib.rs. #![warn(warnings, unused_variables)] -#![deny(unsafe_op_in_unsafe_fn)] use core::{mem, ptr}; use object::{ diff --git a/src/ld_so/start.rs b/src/ld_so/start.rs index eed04d81a4..814a84498d 100644 --- a/src/ld_so/start.rs +++ b/src/ld_so/start.rs @@ -1,7 +1,5 @@ // Start code adapted from https://gitlab.redox-os.org/redox-os/relibc/blob/master/src/start.rs -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{ borrow::ToOwned, boxed::Box, diff --git a/src/ld_so/tcb.rs b/src/ld_so/tcb.rs index 7451fa4f9a..c849d8fad2 100644 --- a/src/ld_so/tcb.rs +++ b/src/ld_so/tcb.rs @@ -1,5 +1,3 @@ -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::vec::Vec; use core::{ cell::UnsafeCell, diff --git a/src/lib.rs b/src/lib.rs index 3ea46c6a6b..1736cd073e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,6 +35,7 @@ #![allow(clippy::derive_hash_xor_eq)] #![allow(clippy::eval_order_dependence)] #![allow(clippy::mut_from_ref)] +#![deny(unsafe_op_in_unsafe_fn)] // TODO: fix these #![warn(unaligned_references)] diff --git a/src/macros.rs b/src/macros.rs index 3cf348fe00..0c7aeb1a8a 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - /// Print to stdout #[macro_export] macro_rules! print { diff --git a/src/out.rs b/src/out.rs index 47d5cc2deb..44158b3cc5 100644 --- a/src/out.rs +++ b/src/out.rs @@ -9,9 +9,6 @@ //! requirement that `&mut` references are never aliased, which can typically not be assumed when //! getting pointers from C. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{cell::UnsafeCell, fmt, marker::PhantomData, mem::MaybeUninit, ptr::NonNull}; /// Wrapper for write-only "out pointers" that are safe to write to diff --git a/src/platform/allocator/mod.rs b/src/platform/allocator/mod.rs index bee1c7628e..1febb92f09 100644 --- a/src/platform/allocator/mod.rs +++ b/src/platform/allocator/mod.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ alloc::{GlobalAlloc, Layout}, cell::SyncUnsafeCell, diff --git a/src/platform/allocator/sys.rs b/src/platform/allocator/sys.rs index 9b720e6395..1bb446e9bb 100644 --- a/src/platform/allocator/sys.rs +++ b/src/platform/allocator/sys.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ header::{ sys_mman::{self, MAP_FAILED, MREMAP_MAYMOVE}, diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 6ac8c20964..8a51cb3429 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{arch::asm, num::NonZeroU64, ptr}; use super::{ERRNO, Pal, types::*}; diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 88b14d6eea..4922e7c622 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -1,8 +1,5 @@ //! Platform abstractions and environment. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use crate::{ error::{Errno, ResultExt}, io::{self, Read, Write}, diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 185816b997..7003047142 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -1,5 +1,3 @@ -#![allow(unsafe_op_in_unsafe_fn)] - use core::{ convert::TryFrom, mem::{self, MaybeUninit, size_of}, diff --git a/src/pthread/mod.rs b/src/pthread/mod.rs index ad49f731cf..de5d92b78a 100644 --- a/src/pthread/mod.rs +++ b/src/pthread/mod.rs @@ -1,8 +1,5 @@ //! Relibc Threads, or RLCT. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::{ cell::UnsafeCell, mem::MaybeUninit, diff --git a/src/raw_cell.rs b/src/raw_cell.rs index 3f311f9d6d..998fccdca0 100644 --- a/src/raw_cell.rs +++ b/src/raw_cell.rs @@ -1,6 +1,3 @@ -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use core::cell::UnsafeCell; /// Wrapper over `UnsafeCell` that can directly be used in statics, where all modifications require diff --git a/src/start.rs b/src/start.rs index 4d5257b693..eb72e34ce6 100644 --- a/src/start.rs +++ b/src/start.rs @@ -1,8 +1,5 @@ //! Startup code. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - use alloc::{boxed::Box, vec::Vec}; use core::{intrinsics, ptr}; use generic_rt::ExpectTlsFree; diff --git a/src/sync/mod.rs b/src/sync/mod.rs index dfbdf5a584..8681145c7d 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -1,8 +1,5 @@ //! Synchronization primitives. -// TODO: set this for entire crate when possible -#![deny(unsafe_op_in_unsafe_fn)] - pub mod barrier; pub mod cond; // TODO: Merge with pthread_mutex