summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-07-22 16:44:06 +0800
committerGitHub <noreply@github.com>2024-07-22 16:44:06 +0800
commit7d81e092a1f9f37005e5129bd31dd31b32e1d616 (patch)
tree6a142fd3379a87891c5f80503929416c2c4a15eb /library/std/src/sys
parent5b915ab022de8fcce23b95c8aa0dd56e0f74b8e6 (diff)
parentdba6b74dd8b31cdb3ca0aba3ed33f644bca42de0 (diff)
downloadrust-7d81e092a1f9f37005e5129bd31dd31b32e1d616.tar.gz
rust-7d81e092a1f9f37005e5129bd31dd31b32e1d616.zip
Rollup merge of #127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35
Clean up warnings + `unsafe_op_in_unsafe_fn` when building std for armv6k-nintendo-3ds

See #127747

ping `@AzureMarker` `@Meziu`

I could only find one instance needing an extra `unsafe` that was not also shared with many other `unix` targets (presumably these will get covered in larger sweeping changes, I didn't want to introduce churn that would potentially conflict with those). The one codepath I found is shared with `vita` however, so also pinging `@nikarh` `@pheki` `@zetanumbers` just to make sure they're aware of this change.

Also removed one unused import from `process_unsupported` which should simply fix the warning for any target that uses it.
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/pal/unix/alloc.rs2
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported.rs1
2 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/alloc.rs b/library/std/src/sys/pal/unix/alloc.rs
index eb3a57c212b..625ba5247f1 100644
--- a/library/std/src/sys/pal/unix/alloc.rs
+++ b/library/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/library/std/src/sys/pal/unix/process/process_unsupported.rs b/library/std/src/sys/pal/unix/process/process_unsupported.rs
index 33d359d3f84..90d53464c83 100644
--- a/library/std/src/sys/pal/unix/process/process_unsupported.rs
+++ b/library/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::*;