Skip to content

Commit

Permalink
Merge #1735
Browse files Browse the repository at this point in the history
1735: Cleanup cfg blocks r=asomers a=rtzoeller

Remove obsolete references to target_env = wasi, target_os = nacl, target_os = osx, and a typo'd target_os = fushsia that didn't compile when fixed.

 - target_env = wasi is dead: rust-lang/rust#60117
 - target_os = nacl is dead: rust-lang/rust#45041
 - target_os = osx is dead, but I can't find a link.

Found while exploring `--check-cfg`, as mentioned in #1734.

Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
  • Loading branch information
bors[bot] and rtzoeller authored Jun 9, 2022
2 parents 649430f + 80f8320 commit 32d597b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> {
cfg_if! {
if #[cfg(any(target_os = "fuchsia",
target_os = "wasi",
target_env = "wasi",
target_env = "uclibc",
target_os = "linux",
target_os = "android",
Expand Down
6 changes: 3 additions & 3 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
any(target_os = "wasi", target_env = "wasi"),
target_os = "wasi",
target_env = "uclibc",
target_os = "freebsd"
))]
Expand Down Expand Up @@ -828,7 +828,7 @@ pub fn fspacectl_all(fd: RawFd, offset: libc::off_t, len: libc::off_t)
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
any(target_os = "wasi", target_env = "wasi"),
target_os = "wasi",
target_env = "uclibc",
target_os = "freebsd"
))]
Expand Down Expand Up @@ -877,7 +877,7 @@ mod posix_fadvise {
target_os = "dragonfly",
target_os = "emscripten",
target_os = "fuchsia",
any(target_os = "wasi", target_env = "wasi"),
target_os = "wasi",
target_os = "freebsd"
))]
pub fn posix_fallocate(fd: RawFd, offset: libc::off_t, len: libc::off_t) -> Result<()> {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ feature! {
}
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "fushsia",
target_os = "linux",
target_os = "netbsd"))]
feature! {
Expand Down
3 changes: 1 addition & 2 deletions src/net/if_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ libc_bitflags!(
target_os = "freebsd",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "osx"))]
target_os = "openbsd"))]
#[cfg_attr(docsrs, doc(cfg(all())))]
IFF_SIMPLEX;
/// Supports multicast. (see
Expand Down
6 changes: 2 additions & 4 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ sockopt_impl!(
#[cfg(any(target_os = "android",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "linux",
target_os = "nacl"))]
target_os = "linux"))]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand Down Expand Up @@ -993,8 +992,7 @@ mod test {
}

#[cfg(any(target_os = "freebsd",
target_os = "linux",
target_os = "nacl"))]
target_os = "linux"))]
#[test]
fn can_get_listen_on_tcp_socket() {
use super::super::*;
Expand Down
3 changes: 1 addition & 2 deletions test/sys/test_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ fn test_so_tcp_keepalive() {
#[cfg(any(target_os = "android",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "linux",
target_os = "nacl"))] {
target_os = "linux"))] {
let x = getsockopt(fd, sockopt::TcpKeepIdle).unwrap();
setsockopt(fd, sockopt::TcpKeepIdle, &(x + 1)).unwrap();
assert_eq!(getsockopt(fd, sockopt::TcpKeepIdle).unwrap(), x + 1);
Expand Down
4 changes: 2 additions & 2 deletions test/test_fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ mod linux_android {
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
any(target_os = "wasi", target_env = "wasi"),
target_os = "wasi",
target_env = "uclibc",
target_os = "freebsd"))]
mod test_posix_fadvise {
Expand Down Expand Up @@ -495,7 +495,7 @@ mod test_posix_fadvise {
target_os = "dragonfly",
target_os = "emscripten",
target_os = "fuchsia",
any(target_os = "wasi", target_env = "wasi"),
target_os = "wasi",
target_os = "freebsd"))]
mod test_posix_fallocate {

Expand Down

0 comments on commit 32d597b

Please sign in to comment.