Skip to content

Commit 64659b0

Browse files
committed
use cfg_if
1 parent 2e2c65d commit 64659b0

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@
277277
#![feature(allow_internal_unstable)]
278278
#![feature(asm_experimental_arch)]
279279
#![feature(autodiff)]
280-
#![feature(cfg_match)]
281280
#![feature(cfg_sanitizer_cfi)]
282281
#![feature(cfg_target_thread_local)]
283282
#![feature(cfi_encoding)]

library/std/src/os/unix/net/stream.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
cfg_match! {
2-
any(
3-
target_os = "linux",
4-
target_os = "android",
5-
target_os = "dragonfly",
6-
target_os = "freebsd",
7-
target_os = "openbsd",
8-
target_os = "netbsd",
9-
target_os = "solaris",
10-
target_os = "illumos",
11-
target_os = "haiku",
12-
target_os = "nto",
13-
target_os = "cygwin"
14-
) => {
1+
cfg_if::cfg_if! {
2+
if #[cfg(any(
3+
target_os = "linux", target_os = "android",
4+
target_os = "hurd",
5+
target_os = "dragonfly", target_os = "freebsd",
6+
target_os = "openbsd", target_os = "netbsd",
7+
target_os = "solaris", target_os = "illumos",
8+
target_os = "haiku", target_os = "nto",
9+
target_os = "cygwin"))] {
1510
use libc::MSG_NOSIGNAL;
16-
}
17-
_ => {
11+
} else {
1812
const MSG_NOSIGNAL: core::ffi::c_int = 0x0;
1913
}
2014
}

0 commit comments

Comments
 (0)