Skip to content

Commit d463aed

Browse files
authored
Unrolled build for rust-lang#127996
Rollup merge of rust-lang#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 rust-lang#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.
2 parents ae7b1c1 + dba6b74 commit d463aed

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-2
lines changed

library/std/src/os/horizon/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Definitions for Horizon OS
22
3+
#![forbid(unsafe_op_in_unsafe_fn)]
34
#![stable(feature = "raw_ext", since = "1.1.0")]
45

56
pub mod fs;

library/std/src/os/horizon/raw.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub type time_t = libc::time_t;
3838
#[repr(C)]
3939
#[derive(Clone)]
4040
#[stable(feature = "raw_ext", since = "1.1.0")]
41+
#[allow(dead_code)] // This exists for parity with other `raw` modules, but isn't actually used.
4142
pub struct stat {
4243
#[stable(feature = "raw_ext", since = "1.1.0")]
4344
pub st_dev: dev_t,

library/std/src/sys/pal/unix/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ cfg_if::cfg_if! {
6767
))] {
6868
#[inline]
6969
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
70-
libc::memalign(layout.align(), layout.size()) as *mut u8
70+
unsafe { libc::memalign(layout.align(), layout.size()) as *mut u8 }
7171
}
7272
} else {
7373
#[inline]

library/std/src/sys/pal/unix/process/process_unsupported.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::fmt;
21
use crate::io;
32
use crate::num::NonZero;
43
use crate::sys::pal::unix::unsupported::*;

0 commit comments

Comments
 (0)