Skip to content

Commit 60091ee

Browse files
committed
Format libstd/os with rustfmt
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/os *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/os -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/os outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
1 parent 9081929 commit 60091ee

File tree

43 files changed

+657
-433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+657
-433
lines changed

src/libstd/os/android/fs.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
#[stable(feature = "metadata_ext", since = "1.1.0")]
21-
#[rustc_deprecated(since = "1.8.0",
22-
reason = "deprecated in favor of the accessor \
23-
methods of this trait")]
21+
#[rustc_deprecated(
22+
since = "1.8.0",
23+
reason = "deprecated in favor of the accessor \
24+
methods of this trait"
25+
)]
2426
#[allow(deprecated)]
2527
fn as_raw_stat(&self) -> &raw::stat;
2628

@@ -62,10 +64,7 @@ pub trait MetadataExt {
6264
impl MetadataExt for Metadata {
6365
#[allow(deprecated)]
6466
fn as_raw_stat(&self) -> &raw::stat {
65-
unsafe {
66-
&*(self.as_inner().as_inner() as *const libc::stat
67-
as *const raw::stat)
68-
}
67+
unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
6968
}
7069
fn st_dev(&self) -> u64 {
7170
self.as_inner().as_inner().st_dev as u64

src/libstd/os/android/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44

5-
pub mod raw;
65
pub mod fs;
6+
pub mod raw;

src/libstd/os/android/raw.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//! Android-specific raw type definitions
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
4-
#![rustc_deprecated(since = "1.8.0",
5-
reason = "these type aliases are no longer supported by \
6-
the standard library, the `libc` crate on \
7-
crates.io should be used instead for the correct \
8-
definitions")]
4+
#![rustc_deprecated(
5+
since = "1.8.0",
6+
reason = "these type aliases are no longer supported by \
7+
the standard library, the `libc` crate on \
8+
crates.io should be used instead for the correct \
9+
definitions"
10+
)]
911
#![allow(deprecated)]
1012

1113
use crate::os::raw::c_long;
@@ -15,12 +17,12 @@ pub type pthread_t = c_long;
1517

1618
#[doc(inline)]
1719
#[stable(feature = "raw_ext", since = "1.1.0")]
18-
pub use self::arch::{dev_t, mode_t, blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
20+
pub use self::arch::{blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t, stat, time_t};
1921

2022
#[cfg(any(target_arch = "arm", target_arch = "x86"))]
2123
mod arch {
22-
use crate::os::raw::{c_uint, c_uchar, c_ulonglong, c_longlong, c_ulong};
23-
use crate::os::unix::raw::{uid_t, gid_t};
24+
use crate::os::raw::{c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong};
25+
use crate::os::unix::raw::{gid_t, uid_t};
2426

2527
#[stable(feature = "raw_ext", since = "1.1.0")]
2628
pub type dev_t = u64;
@@ -83,14 +85,12 @@ mod arch {
8385
#[stable(feature = "raw_ext", since = "1.1.0")]
8486
pub st_ino: c_ulonglong,
8587
}
86-
8788
}
8889

89-
9090
#[cfg(target_arch = "aarch64")]
9191
mod arch {
9292
use crate::os::raw::{c_uchar, c_ulong};
93-
use crate::os::unix::raw::{uid_t, gid_t};
93+
use crate::os::unix::raw::{gid_t, uid_t};
9494

9595
#[stable(feature = "raw_ext", since = "1.1.0")]
9696
pub type dev_t = u64;
@@ -157,8 +157,8 @@ mod arch {
157157

158158
#[cfg(target_arch = "x86_64")]
159159
mod arch {
160-
use crate::os::raw::{c_uint, c_long, c_ulong};
161-
use crate::os::unix::raw::{uid_t, gid_t};
160+
use crate::os::raw::{c_long, c_uint, c_ulong};
161+
use crate::os::unix::raw::{gid_t, uid_t};
162162

163163
#[stable(feature = "raw_ext", since = "1.1.0")]
164164
pub type dev_t = u64;

src/libstd/os/dragonfly/fs.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
#[stable(feature = "metadata_ext", since = "1.1.0")]
21-
#[rustc_deprecated(since = "1.8.0",
22-
reason = "deprecated in favor of the accessor \
23-
methods of this trait")]
21+
#[rustc_deprecated(
22+
since = "1.8.0",
23+
reason = "deprecated in favor of the accessor \
24+
methods of this trait"
25+
)]
2426
#[allow(deprecated)]
2527
fn as_raw_stat(&self) -> &raw::stat;
2628

@@ -68,10 +70,7 @@ pub trait MetadataExt {
6870
impl MetadataExt for Metadata {
6971
#[allow(deprecated)]
7072
fn as_raw_stat(&self) -> &raw::stat {
71-
unsafe {
72-
&*(self.as_inner().as_inner() as *const libc::stat
73-
as *const raw::stat)
74-
}
73+
unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
7574
}
7675
fn st_dev(&self) -> u64 {
7776
self.as_inner().as_inner().st_dev as u64

src/libstd/os/dragonfly/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44

5-
pub mod raw;
65
pub mod fs;
6+
pub mod raw;

src/libstd/os/dragonfly/raw.rs

+25-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
//! Dragonfly-specific raw type definitions
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
4-
#![rustc_deprecated(since = "1.8.0",
5-
reason = "these type aliases are no longer supported by \
6-
the standard library, the `libc` crate on \
7-
crates.io should be used instead for the correct \
8-
definitions")]
4+
#![rustc_deprecated(
5+
since = "1.8.0",
6+
reason = "these type aliases are no longer supported by \
7+
the standard library, the `libc` crate on \
8+
crates.io should be used instead for the correct \
9+
definitions"
10+
)]
911
#![allow(deprecated)]
1012

1113
use crate::os::raw::c_long;
1214

13-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
14-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
15-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
16-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32;
17-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
18-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
19-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
20-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
21-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
15+
#[stable(feature = "raw_ext", since = "1.1.0")]
16+
pub type blkcnt_t = u64;
17+
#[stable(feature = "raw_ext", since = "1.1.0")]
18+
pub type blksize_t = u64;
19+
#[stable(feature = "raw_ext", since = "1.1.0")]
20+
pub type dev_t = u64;
21+
#[stable(feature = "raw_ext", since = "1.1.0")]
22+
pub type fflags_t = u32;
23+
#[stable(feature = "raw_ext", since = "1.1.0")]
24+
pub type ino_t = u64;
25+
#[stable(feature = "raw_ext", since = "1.1.0")]
26+
pub type mode_t = u32;
27+
#[stable(feature = "raw_ext", since = "1.1.0")]
28+
pub type nlink_t = u64;
29+
#[stable(feature = "raw_ext", since = "1.1.0")]
30+
pub type off_t = u64;
31+
#[stable(feature = "raw_ext", since = "1.1.0")]
32+
pub type time_t = i64;
2233

2334
#[stable(feature = "pthread_t", since = "1.8.0")]
2435
pub type pthread_t = usize;

src/libstd/os/emscripten/fs.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
#[stable(feature = "metadata_ext", since = "1.1.0")]
21-
#[rustc_deprecated(since = "1.8.0",
22-
reason = "deprecated in favor of the accessor \
23-
methods of this trait")]
21+
#[rustc_deprecated(
22+
since = "1.8.0",
23+
reason = "deprecated in favor of the accessor \
24+
methods of this trait"
25+
)]
2426
#[allow(deprecated)]
2527
fn as_raw_stat(&self) -> &raw::stat;
2628

@@ -62,10 +64,7 @@ pub trait MetadataExt {
6264
impl MetadataExt for Metadata {
6365
#[allow(deprecated)]
6466
fn as_raw_stat(&self) -> &raw::stat {
65-
unsafe {
66-
&*(self.as_inner().as_inner() as *const libc::stat64
67-
as *const raw::stat)
68-
}
67+
unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) }
6968
}
7069
fn st_dev(&self) -> u64 {
7170
self.as_inner().as_inner().st_dev as u64

src/libstd/os/emscripten/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44

5-
pub mod raw;
65
pub mod fs;
6+
pub mod raw;

src/libstd/os/emscripten/raw.rs

+23-13
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,38 @@
33
//! except using the musl-specific stat64 structure in liblibc.
44
55
#![stable(feature = "raw_ext", since = "1.1.0")]
6-
#![rustc_deprecated(since = "1.8.0",
7-
reason = "these type aliases are no longer supported by \
8-
the standard library, the `libc` crate on \
9-
crates.io should be used instead for the correct \
10-
definitions")]
6+
#![rustc_deprecated(
7+
since = "1.8.0",
8+
reason = "these type aliases are no longer supported by \
9+
the standard library, the `libc` crate on \
10+
crates.io should be used instead for the correct \
11+
definitions"
12+
)]
1113
#![allow(deprecated)]
1214

1315
use crate::os::raw::{c_long, c_short, c_uint, c_ulong};
1416

15-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
16-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
17+
#[stable(feature = "raw_ext", since = "1.1.0")]
18+
pub type dev_t = u64;
19+
#[stable(feature = "raw_ext", since = "1.1.0")]
20+
pub type mode_t = u32;
1721

1822
#[stable(feature = "pthread_t", since = "1.8.0")]
1923
pub type pthread_t = c_ulong;
2024

2125
#[doc(inline)]
22-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
23-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
24-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
25-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
26-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
27-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = c_long;
26+
#[stable(feature = "raw_ext", since = "1.1.0")]
27+
pub type blkcnt_t = u64;
28+
#[stable(feature = "raw_ext", since = "1.1.0")]
29+
pub type blksize_t = u64;
30+
#[stable(feature = "raw_ext", since = "1.1.0")]
31+
pub type ino_t = u64;
32+
#[stable(feature = "raw_ext", since = "1.1.0")]
33+
pub type nlink_t = u64;
34+
#[stable(feature = "raw_ext", since = "1.1.0")]
35+
pub type off_t = u64;
36+
#[stable(feature = "raw_ext", since = "1.1.0")]
37+
pub type time_t = c_long;
2838

2939
#[repr(C)]
3040
#[derive(Clone)]

src/libstd/os/fortanix_sgx/mod.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ pub mod usercalls {
2121

2222
/// Lowest-level interfaces to usercalls and usercall ABI type definitions.
2323
pub mod raw {
24+
pub use crate::sys::abi::usercalls::raw::{
25+
accept_stream, alloc, async_queues, bind_stream, close, connect_stream, exit, flush,
26+
free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
27+
};
2428
pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};
25-
pub use crate::sys::abi::usercalls::raw::{accept_stream, alloc, async_queues, bind_stream,
26-
close, connect_stream, exit, flush, free, insecure_time,
27-
launch_thread, read, read_alloc, send, wait, write};
2829

2930
// fortanix-sgx-abi re-exports
30-
pub use crate::sys::abi::usercalls::raw::{ByteBuffer, FifoDescriptor, Return, Usercall};
3131
pub use crate::sys::abi::usercalls::raw::Error;
32-
pub use crate::sys::abi::usercalls::raw::{EV_RETURNQ_NOT_EMPTY, EV_UNPARK,
33-
EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
34-
RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE,
35-
WAIT_NO};
32+
pub use crate::sys::abi::usercalls::raw::{ByteBuffer, FifoDescriptor, Return, Usercall};
3633
pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
34+
pub use crate::sys::abi::usercalls::raw::{
35+
EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
36+
RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
37+
};
3738
}
3839
}
3940

@@ -42,7 +43,7 @@ pub mod mem {
4243
pub use crate::sys::abi::mem::*;
4344
}
4445

45-
pub use crate::sys::ext::{io, arch, ffi};
46+
pub use crate::sys::ext::{arch, ffi, io};
4647

4748
/// Functions for querying thread-related information.
4849
pub mod thread {

src/libstd/os/freebsd/fs.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub trait MetadataExt {
1818
/// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the
1919
/// cross-Unix abstractions contained within the raw stat.
2020
#[stable(feature = "metadata_ext", since = "1.1.0")]
21-
#[rustc_deprecated(since = "1.8.0",
22-
reason = "deprecated in favor of the accessor \
23-
methods of this trait")]
21+
#[rustc_deprecated(
22+
since = "1.8.0",
23+
reason = "deprecated in favor of the accessor \
24+
methods of this trait"
25+
)]
2426
#[allow(deprecated)]
2527
fn as_raw_stat(&self) -> &raw::stat;
2628

@@ -72,10 +74,7 @@ pub trait MetadataExt {
7274
impl MetadataExt for Metadata {
7375
#[allow(deprecated)]
7476
fn as_raw_stat(&self) -> &raw::stat {
75-
unsafe {
76-
&*(self.as_inner().as_inner() as *const libc::stat
77-
as *const raw::stat)
78-
}
77+
unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
7978
}
8079
fn st_dev(&self) -> u64 {
8180
self.as_inner().as_inner().st_dev as u64

src/libstd/os/freebsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44

5-
pub mod raw;
65
pub mod fs;
6+
pub mod raw;

src/libstd/os/freebsd/raw.rs

+25-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
//! FreeBSD-specific raw type definitions
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
4-
#![rustc_deprecated(since = "1.8.0",
5-
reason = "these type aliases are no longer supported by \
6-
the standard library, the `libc` crate on \
7-
crates.io should be used instead for the correct \
8-
definitions")]
4+
#![rustc_deprecated(
5+
since = "1.8.0",
6+
reason = "these type aliases are no longer supported by \
7+
the standard library, the `libc` crate on \
8+
crates.io should be used instead for the correct \
9+
definitions"
10+
)]
911
#![allow(deprecated)]
1012

1113
use crate::os::raw::c_long;
1214

13-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
14-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
15-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
16-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32;
17-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
18-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
19-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
20-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
21-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
15+
#[stable(feature = "raw_ext", since = "1.1.0")]
16+
pub type blkcnt_t = u64;
17+
#[stable(feature = "raw_ext", since = "1.1.0")]
18+
pub type blksize_t = u64;
19+
#[stable(feature = "raw_ext", since = "1.1.0")]
20+
pub type dev_t = u64;
21+
#[stable(feature = "raw_ext", since = "1.1.0")]
22+
pub type fflags_t = u32;
23+
#[stable(feature = "raw_ext", since = "1.1.0")]
24+
pub type ino_t = u64;
25+
#[stable(feature = "raw_ext", since = "1.1.0")]
26+
pub type mode_t = u32;
27+
#[stable(feature = "raw_ext", since = "1.1.0")]
28+
pub type nlink_t = u64;
29+
#[stable(feature = "raw_ext", since = "1.1.0")]
30+
pub type off_t = u64;
31+
#[stable(feature = "raw_ext", since = "1.1.0")]
32+
pub type time_t = i64;
2233

2334
#[stable(feature = "pthread_t", since = "1.8.0")]
2435
pub type pthread_t = usize;

src/libstd/os/fuchsia/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44

5-
pub mod raw;
65
pub mod fs;
6+
pub mod raw;

0 commit comments

Comments
 (0)