diff options
| author | Nicole LeGare <legare@google.com> | 2025-02-04 22:18:53 +0000 |
|---|---|---|
| committer | Nicole L <dlegare.1001@gmail.com> | 2025-03-10 10:00:25 -0700 |
| commit | d633d8e074512fde1b1e7507ae758c8a7f96639b (patch) | |
| tree | 166650efec95b5d465135df635e646a465d4fb29 | |
| parent | 7f6ee12526700e037ef34912b2b0c628028d382c (diff) | |
| download | rust-d633d8e074512fde1b1e7507ae758c8a7f96639b.tar.gz rust-d633d8e074512fde1b1e7507ae758c8a7f96639b.zip | |
Format after patches have been applied
| -rw-r--r-- | library/std/src/os/fd/owned.rs | 11 | ||||
| -rw-r--r-- | library/std/src/os/fd/raw.rs | 6 | ||||
| -rw-r--r-- | library/std/src/sys/pal/trusty/mod.rs | 10 | ||||
| -rw-r--r-- | library/std/src/sys/pal/trusty/stdio.rs | 3 |
4 files changed, 17 insertions, 13 deletions
diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index 9743da96197..701cf823357 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -4,15 +4,20 @@ #![deny(unsafe_op_in_unsafe_fn)] use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; +#[cfg(not(target_os = "trusty"))] +use crate::fs; use crate::marker::PhantomData; use crate::mem::ManuallyDrop; -#[cfg(not(any(target_arch = "wasm32", target_env = "sgx", target_os = "hermit", target_os = "trusty")))] +#[cfg(not(any( + target_arch = "wasm32", + target_env = "sgx", + target_os = "hermit", + target_os = "trusty" +)))] use crate::sys::cvt; #[cfg(not(target_os = "trusty"))] use crate::sys_common::{AsInner, FromInner, IntoInner}; use crate::{fmt, io}; -#[cfg(not(target_os = "trusty"))] -use crate::fs; type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>; diff --git a/library/std/src/os/fd/raw.rs b/library/std/src/os/fd/raw.rs index 8cbed7d9686..083ac6e3fe6 100644 --- a/library/std/src/os/fd/raw.rs +++ b/library/std/src/os/fd/raw.rs @@ -5,6 +5,9 @@ #[cfg(target_os = "hermit")] use hermit_abi as libc; +#[cfg(not(target_os = "trusty"))] +use crate::fs; +use crate::io; #[cfg(target_os = "hermit")] use crate::os::hermit::io::OwnedFd; #[cfg(not(target_os = "hermit"))] @@ -17,9 +20,6 @@ use crate::os::unix::io::OwnedFd; use crate::os::wasi::io::OwnedFd; #[cfg(not(target_os = "trusty"))] use crate::sys_common::{AsInner, IntoInner}; -#[cfg(not(target_os = "trusty"))] -use crate::fs; -use crate::io; /// Raw file descriptors. #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/std/src/sys/pal/trusty/mod.rs b/library/std/src/sys/pal/trusty/mod.rs index 41005205c83..2b2774119e1 100644 --- a/library/std/src/sys/pal/trusty/mod.rs +++ b/library/std/src/sys/pal/trusty/mod.rs @@ -2,6 +2,9 @@ #[path = "../unsupported/args.rs"] pub mod args; +#[path = "../unsupported/common.rs"] +#[deny(unsafe_op_in_unsafe_fn)] +mod common; #[path = "../unsupported/env.rs"] pub mod env; #[path = "../unsupported/fs.rs"] @@ -17,12 +20,9 @@ pub mod pipe; #[path = "../unsupported/process.rs"] pub mod process; pub mod stdio; -#[path = "../unsupported/time.rs"] -pub mod time; #[path = "../unsupported/thread.rs"] pub mod thread; -#[path = "../unsupported/common.rs"] -#[deny(unsafe_op_in_unsafe_fn)] -mod common; +#[path = "../unsupported/time.rs"] +pub mod time; pub use common::*; diff --git a/library/std/src/sys/pal/trusty/stdio.rs b/library/std/src/sys/pal/trusty/stdio.rs index 3f7c9f76e71..d393e95394d 100644 --- a/library/std/src/sys/pal/trusty/stdio.rs +++ b/library/std/src/sys/pal/trusty/stdio.rs @@ -59,8 +59,7 @@ pub fn panic_output() -> Option<impl io::Write> { } fn _write(fd: i32, message: &[u8]) -> io::Result<usize> { - let mut iov = - libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() }; + let mut iov = libc::iovec { iov_base: message.as_ptr() as *mut _, iov_len: message.len() }; loop { // SAFETY: syscall, safe arguments. let ret = unsafe { libc::writev(fd, &iov, 1) }; |
