From b5a83a6f718f7e56a403088b94e8df1bbe20169a Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 16 Jul 2024 16:14:21 -0700 Subject: [PATCH 1/2] xous: Forbid unwrapped unsafe in platform modules --- library/std/src/os/xous/mod.rs | 1 + library/std/src/sys/pal/xous/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/os/xous/mod.rs b/library/std/src/os/xous/mod.rs index 153694a89a78d..4b21695c4ac7e 100644 --- a/library/std/src/os/xous/mod.rs +++ b/library/std/src/os/xous/mod.rs @@ -1,5 +1,6 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(cfg(target_os = "xous"))] +#![forbid(unsafe_op_in_unsafe_fn)] pub mod ffi; diff --git a/library/std/src/sys/pal/xous/mod.rs b/library/std/src/sys/pal/xous/mod.rs index a28a52e305e22..961d45c5e834f 100644 --- a/library/std/src/sys/pal/xous/mod.rs +++ b/library/std/src/sys/pal/xous/mod.rs @@ -1,4 +1,4 @@ -#![deny(unsafe_op_in_unsafe_fn)] +#![forbid(unsafe_op_in_unsafe_fn)] pub mod alloc; #[path = "../unsupported/args.rs"] From 586ef83f3f589e4d1eab7895982b9e7cee827fce Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 16 Jul 2024 16:17:38 -0700 Subject: [PATCH 2/2] uefi: Forbid unwrapped unsafe in platform modules --- library/std/src/os/uefi/mod.rs | 1 + library/std/src/sys/pal/uefi/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/library/std/src/os/uefi/mod.rs b/library/std/src/os/uefi/mod.rs index 8ef05eee1f4e7..b42d796b28f69 100644 --- a/library/std/src/os/uefi/mod.rs +++ b/library/std/src/os/uefi/mod.rs @@ -2,6 +2,7 @@ #![unstable(feature = "uefi_std", issue = "100499")] #![doc(cfg(target_os = "uefi"))] +#![forbid(unsafe_op_in_unsafe_fn)] pub mod env; #[path = "../windows/ffi.rs"] diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs index 408031a461665..4d50d9e8c3d9c 100644 --- a/library/std/src/sys/pal/uefi/mod.rs +++ b/library/std/src/sys/pal/uefi/mod.rs @@ -11,6 +11,7 @@ //! //! [`OsStr`]: crate::ffi::OsStr //! [`OsString`]: crate::ffi::OsString +#![forbid(unsafe_op_in_unsafe_fn)] pub mod alloc; pub mod args;