diff --git a/std/src/os/horizon/mod.rs b/std/src/os/horizon/mod.rs index 326d0ae9cb96d..14ce409f42c0b 100644 --- a/std/src/os/horizon/mod.rs +++ b/std/src/os/horizon/mod.rs @@ -1,5 +1,6 @@ //! Definitions for Horizon OS +#![forbid(unsafe_op_in_unsafe_fn)] #![stable(feature = "raw_ext", since = "1.1.0")] pub mod fs; diff --git a/std/src/os/horizon/raw.rs b/std/src/os/horizon/raw.rs index 929fa7db1f964..e5368ea265a13 100644 --- a/std/src/os/horizon/raw.rs +++ b/std/src/os/horizon/raw.rs @@ -38,6 +38,7 @@ pub type time_t = libc::time_t; #[repr(C)] #[derive(Clone)] #[stable(feature = "raw_ext", since = "1.1.0")] +#[allow(dead_code)] // This exists for parity with other `raw` modules, but isn't actually used. pub struct stat { #[stable(feature = "raw_ext", since = "1.1.0")] pub st_dev: dev_t, diff --git a/std/src/sys/pal/unix/alloc.rs b/std/src/sys/pal/unix/alloc.rs index eb3a57c212b4a..625ba5247f111 100644 --- a/std/src/sys/pal/unix/alloc.rs +++ b/std/src/sys/pal/unix/alloc.rs @@ -67,7 +67,7 @@ cfg_if::cfg_if! { ))] { #[inline] unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { - libc::memalign(layout.align(), layout.size()) as *mut u8 + unsafe { libc::memalign(layout.align(), layout.size()) as *mut u8 } } } else { #[inline] diff --git a/std/src/sys/pal/unix/process/process_unsupported.rs b/std/src/sys/pal/unix/process/process_unsupported.rs index 33d359d3f8411..90d53464c83f1 100644 --- a/std/src/sys/pal/unix/process/process_unsupported.rs +++ b/std/src/sys/pal/unix/process/process_unsupported.rs @@ -1,4 +1,3 @@ -use crate::fmt; use crate::io; use crate::num::NonZero; use crate::sys::pal::unix::unsupported::*;