Skip to content

Commit a5afc83

Browse files
authored
Unrolled build for rust-lang#128315
Rollup merge of rust-lang#128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubilee Fix vita build of std and forbid unsafe in unsafe in the os/vita module See rust-lang#127747 r? `@workingjubilee` `@pheki` `@nikarh`
2 parents 710ce90 + 0a5a84e commit a5afc83

File tree

4 files changed

+5
-37
lines changed

4 files changed

+5
-37
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Definitions for vita
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/vita/raw.rs

-37
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
)]
1111
#![allow(deprecated)]
1212

13-
use crate::os::raw::c_long;
14-
use crate::os::unix::raw::{gid_t, uid_t};
15-
1613
#[stable(feature = "pthread_t", since = "1.8.0")]
1714
pub type pthread_t = libc::pthread_t;
1815

@@ -34,37 +31,3 @@ pub type off_t = libc::off_t;
3431

3532
#[stable(feature = "raw_ext", since = "1.1.0")]
3633
pub type time_t = libc::time_t;
37-
38-
#[repr(C)]
39-
#[derive(Clone)]
40-
#[stable(feature = "raw_ext", since = "1.1.0")]
41-
pub struct stat {
42-
#[stable(feature = "raw_ext", since = "1.1.0")]
43-
pub st_dev: dev_t,
44-
#[stable(feature = "raw_ext", since = "1.1.0")]
45-
pub st_ino: ino_t,
46-
#[stable(feature = "raw_ext", since = "1.1.0")]
47-
pub st_mode: mode_t,
48-
#[stable(feature = "raw_ext", since = "1.1.0")]
49-
pub st_nlink: nlink_t,
50-
#[stable(feature = "raw_ext", since = "1.1.0")]
51-
pub st_uid: uid_t,
52-
#[stable(feature = "raw_ext", since = "1.1.0")]
53-
pub st_gid: gid_t,
54-
#[stable(feature = "raw_ext", since = "1.1.0")]
55-
pub st_rdev: dev_t,
56-
#[stable(feature = "raw_ext", since = "1.1.0")]
57-
pub st_size: off_t,
58-
#[stable(feature = "raw_ext", since = "1.1.0")]
59-
pub st_atime: time_t,
60-
#[stable(feature = "raw_ext", since = "1.1.0")]
61-
pub st_mtime: time_t,
62-
#[stable(feature = "raw_ext", since = "1.1.0")]
63-
pub st_ctime: time_t,
64-
#[stable(feature = "raw_ext", since = "1.1.0")]
65-
pub st_blksize: blksize_t,
66-
#[stable(feature = "raw_ext", since = "1.1.0")]
67-
pub st_blocks: blkcnt_t,
68-
#[stable(feature = "raw_ext", since = "1.1.0")]
69-
pub st_spare4: [c_long; 2usize],
70-
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
166166
target_os = "fuchsia",
167167
target_os = "horizon",
168168
target_os = "vxworks",
169+
target_os = "vita",
169170
// Unikraft's `signal` implementation is currently broken:
170171
// https://github.com/unikraft/lib-musl/issues/57
171172
target_vendor = "unikraft",
@@ -212,6 +213,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
212213
target_os = "fuchsia",
213214
target_os = "horizon",
214215
target_os = "vxworks",
216+
target_os = "vita",
215217
)))]
216218
static ON_BROKEN_PIPE_FLAG_USED: crate::sync::atomic::AtomicBool =
217219
crate::sync::atomic::AtomicBool::new(false);
@@ -222,6 +224,7 @@ static ON_BROKEN_PIPE_FLAG_USED: crate::sync::atomic::AtomicBool =
222224
target_os = "fuchsia",
223225
target_os = "horizon",
224226
target_os = "vxworks",
227+
target_os = "vita",
225228
)))]
226229
pub(crate) fn on_broken_pipe_flag_used() -> bool {
227230
ON_BROKEN_PIPE_FLAG_USED.load(crate::sync::atomic::Ordering::Relaxed)

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

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub struct StdioPipes {
124124

125125
// passed to do_exec() with configuration of what the child stdio should look
126126
// like
127+
#[cfg_attr(target_os = "vita", allow(dead_code))]
127128
pub struct ChildPipes {
128129
pub stdin: ChildStdio,
129130
pub stdout: ChildStdio,

0 commit comments

Comments
 (0)