Skip to content

Commit 6685634

Browse files
committed
Format after patches have been applied
1 parent 0a44d22 commit 6685634

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

library/std/src/os/fd/owned.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
#![deny(unsafe_op_in_unsafe_fn)]
55

66
use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
7+
#[cfg(not(target_os = "trusty"))]
8+
use crate::fs;
79
use crate::marker::PhantomData;
810
use crate::mem::ManuallyDrop;
9-
#[cfg(not(any(target_arch = "wasm32", target_env = "sgx", target_os = "hermit", target_os = "trusty")))]
11+
#[cfg(not(any(
12+
target_arch = "wasm32",
13+
target_env = "sgx",
14+
target_os = "hermit",
15+
target_os = "trusty"
16+
)))]
1017
use crate::sys::cvt;
1118
#[cfg(not(target_os = "trusty"))]
1219
use crate::sys_common::{AsInner, FromInner, IntoInner};
1320
use crate::{fmt, io};
14-
#[cfg(not(target_os = "trusty"))]
15-
use crate::fs;
1621

1722
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
1823

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#[cfg(target_os = "hermit")]
66
use hermit_abi as libc;
77

8+
#[cfg(not(target_os = "trusty"))]
9+
use crate::fs;
10+
use crate::io;
811
#[cfg(target_os = "hermit")]
912
use crate::os::hermit::io::OwnedFd;
1013
#[cfg(not(target_os = "hermit"))]
@@ -17,9 +20,6 @@ use crate::os::unix::io::OwnedFd;
1720
use crate::os::wasi::io::OwnedFd;
1821
#[cfg(not(target_os = "trusty"))]
1922
use crate::sys_common::{AsInner, IntoInner};
20-
#[cfg(not(target_os = "trusty"))]
21-
use crate::fs;
22-
use crate::io;
2323

2424
/// Raw file descriptors.
2525
#[stable(feature = "rust1", since = "1.0.0")]

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
33
#[path = "../unsupported/args.rs"]
44
pub mod args;
5+
#[path = "../unsupported/common.rs"]
6+
#[deny(unsafe_op_in_unsafe_fn)]
7+
mod common;
58
#[path = "../unsupported/env.rs"]
69
pub mod env;
710
#[path = "../unsupported/fs.rs"]
@@ -17,12 +20,9 @@ pub mod pipe;
1720
#[path = "../unsupported/process.rs"]
1821
pub mod process;
1922
pub mod stdio;
20-
#[path = "../unsupported/time.rs"]
21-
pub mod time;
2223
#[path = "../unsupported/thread.rs"]
2324
pub mod thread;
24-
#[path = "../unsupported/common.rs"]
25-
#[deny(unsafe_op_in_unsafe_fn)]
26-
mod common;
25+
#[path = "../unsupported/time.rs"]
26+
pub mod time;
2727

2828
pub use common::*;

library/std/src/sys/pal/trusty/stdio.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ pub fn panic_output() -> Option<impl io::Write> {
5959
}
6060

6161
fn _write(fd: i32, message: &[u8]) -> io::Result<usize> {
62-
let mut iov =
63-
libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() };
62+
let mut iov = libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() };
6463
loop {
6564
// SAFETY: syscall, safe arguments.
6665
let ret = unsafe { libc::writev(fd, &iov, 1) };

0 commit comments

Comments
 (0)