Skip to content

Commit 5ee1ab8

Browse files
authored
Alphabetize cfg's. (#1359)
For tidiness, keep the `target_os = "..."` lists sorted alphabetically.
1 parent 7f23055 commit 5ee1ab8

8 files changed

Lines changed: 24 additions & 24 deletions

File tree

src/backend/libc/net/sockopt.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use alloc::borrow::ToOwned as _;
7171
use alloc::string::String;
7272
#[cfg(apple)]
7373
use c::TCP_KEEPALIVE as TCP_KEEPIDLE;
74-
#[cfg(not(any(apple, target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
74+
#[cfg(not(any(apple, target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
7575
use c::TCP_KEEPIDLE;
7676
use core::mem::{size_of, MaybeUninit};
7777
use core::time::Duration;
@@ -887,9 +887,9 @@ pub(crate) fn tcp_nodelay(fd: BorrowedFd<'_>) -> io::Result<bool> {
887887

888888
#[inline]
889889
#[cfg(not(any(
890-
target_os = "openbsd",
891890
target_os = "haiku",
892891
target_os = "nto",
892+
target_os = "openbsd",
893893
target_os = "redox"
894894
)))]
895895
pub(crate) fn set_tcp_keepcnt(fd: BorrowedFd<'_>, count: u32) -> io::Result<()> {
@@ -898,34 +898,34 @@ pub(crate) fn set_tcp_keepcnt(fd: BorrowedFd<'_>, count: u32) -> io::Result<()>
898898

899899
#[inline]
900900
#[cfg(not(any(
901-
target_os = "openbsd",
902901
target_os = "haiku",
903902
target_os = "nto",
903+
target_os = "openbsd",
904904
target_os = "redox"
905905
)))]
906906
pub(crate) fn tcp_keepcnt(fd: BorrowedFd<'_>) -> io::Result<u32> {
907907
getsockopt(fd, c::IPPROTO_TCP, c::TCP_KEEPCNT)
908908
}
909909

910910
#[inline]
911-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
911+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
912912
pub(crate) fn set_tcp_keepidle(fd: BorrowedFd<'_>, duration: Duration) -> io::Result<()> {
913913
let secs: c::c_uint = duration_to_secs(duration)?;
914914
setsockopt(fd, c::IPPROTO_TCP, TCP_KEEPIDLE, secs)
915915
}
916916

917917
#[inline]
918-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
918+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
919919
pub(crate) fn tcp_keepidle(fd: BorrowedFd<'_>) -> io::Result<Duration> {
920920
let secs: c::c_uint = getsockopt(fd, c::IPPROTO_TCP, TCP_KEEPIDLE)?;
921921
Ok(Duration::from_secs(secs as u64))
922922
}
923923

924924
#[inline]
925925
#[cfg(not(any(
926-
target_os = "openbsd",
927926
target_os = "haiku",
928927
target_os = "nto",
928+
target_os = "openbsd",
929929
target_os = "redox"
930930
)))]
931931
pub(crate) fn set_tcp_keepintvl(fd: BorrowedFd<'_>, duration: Duration) -> io::Result<()> {
@@ -935,9 +935,9 @@ pub(crate) fn set_tcp_keepintvl(fd: BorrowedFd<'_>, duration: Duration) -> io::R
935935

936936
#[inline]
937937
#[cfg(not(any(
938-
target_os = "openbsd",
939938
target_os = "haiku",
940939
target_os = "nto",
940+
target_os = "openbsd",
941941
target_os = "redox"
942942
)))]
943943
pub(crate) fn tcp_keepintvl(fd: BorrowedFd<'_>) -> io::Result<Duration> {

src/backend/libc/process/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! libc syscalls supporting `rustix::process`.
22
33
use crate::backend::c;
4-
#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
4+
#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
55
use crate::backend::conv::borrowed_fd;
66
#[cfg(any(target_os = "linux", feature = "fs"))]
77
use crate::backend::conv::c_str;
@@ -20,7 +20,7 @@ use crate::backend::conv::ret_pid_t;
2020
#[cfg(all(feature = "alloc", not(target_os = "wasi")))]
2121
use crate::backend::conv::ret_usize;
2222
use crate::backend::conv::{ret, ret_c_int};
23-
#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
23+
#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
2424
use crate::fd::BorrowedFd;
2525
#[cfg(target_os = "linux")]
2626
use crate::fd::{AsRawFd as _, OwnedFd, RawFd};

src/backend/libc/process/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub enum Resource {
3838
Core = bitcast!(c::RLIMIT_CORE),
3939
/// `RLIMIT_RSS`
4040
// "nto" has `RLIMIT_RSS`, but it has the same value as `RLIMIT_AS`.
41-
#[cfg(not(any(apple, solarish, target_os = "nto", target_os = "haiku")))]
41+
#[cfg(not(any(apple, solarish, target_os = "haiku", target_os = "nto")))]
4242
Rss = bitcast!(c::RLIMIT_RSS),
4343
/// `RLIMIT_NPROC`
4444
#[cfg(not(any(solarish, target_os = "haiku")))]

src/backend/libc/termios/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ use crate::ffi;
1313
pub type tcflag_t = ffi::c_ulong;
1414
#[cfg(target_os = "redox")]
1515
pub type tcflag_t = u32;
16-
#[cfg(not(any(target_os = "wasi", apple, target_os = "redox")))]
16+
#[cfg(not(any(apple, target_os = "redox", target_os = "wasi")))]
1717
pub type tcflag_t = ffi::c_uint;

src/ioctl/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ type _Opcode = c::c_ulong;
326326
target_os = "aix",
327327
target_os = "fuchsia",
328328
target_os = "emscripten",
329-
target_os = "wasi",
330-
target_os = "nto"
329+
target_os = "nto",
330+
target_os = "wasi"
331331
))]
332332
type _Opcode = c::c_int;
333333

src/net/sockopt.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,9 @@ pub fn tcp_nodelay<Fd: AsFd>(fd: Fd) -> io::Result<bool> {
12871287
///
12881288
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
12891289
#[cfg(not(any(
1290-
target_os = "openbsd",
12911290
target_os = "haiku",
12921291
target_os = "nto",
1292+
target_os = "openbsd",
12931293
target_os = "redox"
12941294
)))]
12951295
#[inline]
@@ -1304,9 +1304,9 @@ pub fn set_tcp_keepcnt<Fd: AsFd>(fd: Fd, value: u32) -> io::Result<()> {
13041304
///
13051305
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
13061306
#[cfg(not(any(
1307-
target_os = "openbsd",
13081307
target_os = "haiku",
13091308
target_os = "nto",
1309+
target_os = "openbsd",
13101310
target_os = "redox"
13111311
)))]
13121312
#[inline]
@@ -1322,7 +1322,7 @@ pub fn tcp_keepcnt<Fd: AsFd>(fd: Fd) -> io::Result<u32> {
13221322
/// See the [module-level documentation] for more.
13231323
///
13241324
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
1325-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
1325+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
13261326
#[inline]
13271327
#[doc(alias = "TCP_KEEPIDLE")]
13281328
pub fn set_tcp_keepidle<Fd: AsFd>(fd: Fd, value: Duration) -> io::Result<()> {
@@ -1336,7 +1336,7 @@ pub fn set_tcp_keepidle<Fd: AsFd>(fd: Fd, value: Duration) -> io::Result<()> {
13361336
/// See the [module-level documentation] for more.
13371337
///
13381338
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
1339-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
1339+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
13401340
#[inline]
13411341
#[doc(alias = "TCP_KEEPIDLE")]
13421342
pub fn tcp_keepidle<Fd: AsFd>(fd: Fd) -> io::Result<Duration> {
@@ -1349,9 +1349,9 @@ pub fn tcp_keepidle<Fd: AsFd>(fd: Fd) -> io::Result<Duration> {
13491349
///
13501350
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
13511351
#[cfg(not(any(
1352-
target_os = "openbsd",
13531352
target_os = "haiku",
13541353
target_os = "nto",
1354+
target_os = "openbsd",
13551355
target_os = "redox"
13561356
)))]
13571357
#[inline]
@@ -1366,9 +1366,9 @@ pub fn set_tcp_keepintvl<Fd: AsFd>(fd: Fd, value: Duration) -> io::Result<()> {
13661366
///
13671367
/// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions
13681368
#[cfg(not(any(
1369-
target_os = "openbsd",
13701369
target_os = "haiku",
13711370
target_os = "nto",
1371+
target_os = "openbsd",
13721372
target_os = "redox"
13731373
)))]
13741374
#[inline]

tests/net/sockopt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ fn test_sockopts_tcp(s: &OwnedFd) {
202202
assert!(!sockopt::tcp_nodelay(s).unwrap());
203203

204204
#[cfg(not(any(
205-
target_os = "openbsd",
206205
target_os = "haiku",
207206
target_os = "nto",
207+
target_os = "openbsd",
208208
target_os = "redox"
209209
)))]
210210
{
211211
assert!(sockopt::tcp_keepcnt(s).is_ok());
212212
assert!(sockopt::tcp_keepintvl(s).is_ok());
213213
}
214-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
214+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
215215
{
216216
assert!(sockopt::tcp_keepidle(s).is_ok());
217217
}
@@ -228,7 +228,7 @@ fn test_sockopts_tcp(s: &OwnedFd) {
228228
// Check that the nodelay flag is cleared.
229229
assert!(!sockopt::tcp_nodelay(s).unwrap());
230230

231-
#[cfg(not(any(target_os = "openbsd", target_os = "haiku", target_os = "nto")))]
231+
#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))]
232232
{
233233
#[cfg(not(target_os = "redox"))]
234234
{

tests/process/wait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ fn test_waitpgid() {
9292
}
9393

9494
#[cfg(not(any(
95-
target_os = "wasi",
9695
target_os = "emscripten",
96+
target_os = "openbsd",
9797
target_os = "redox",
98-
target_os = "openbsd"
98+
target_os = "wasi"
9999
)))]
100100
#[test]
101101
#[serial]

0 commit comments

Comments
 (0)