Skip to content

Commit 8a5a165

Browse files
committed
Only impl std traits if feature is specified
This is a breaking change
1 parent 5cfa668 commit 8a5a165

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/lib.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,13 @@ pub use crate::error::Error;
160160
#[allow(dead_code)]
161161
mod util;
162162

163-
cfg_if! {
164-
// Unlike the other Unix, Fuchsia and iOS don't use the libc to make any calls.
165-
if #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "emscripten",
166-
target_os = "freebsd", target_os = "haiku", target_os = "illumos",
167-
target_os = "linux", target_os = "macos", target_os = "netbsd",
168-
target_os = "openbsd", target_os = "redox", target_os = "solaris"))] {
169-
#[allow(dead_code)]
170-
mod util_libc;
171-
// Keep std-only trait definitions for backwards compatiblity
172-
mod error_impls;
173-
} else if #[cfg(feature = "std")] {
174-
mod error_impls;
175-
}
176-
}
163+
// Unlike the other Unix, Fuchsia and iOS don't use the libc to make any calls.
164+
#[cfg(unix)]
165+
#[allow(dead_code)]
166+
mod util_libc;
167+
168+
#[cfg(feature = "std")]
169+
mod error_impls;
177170

178171
// These targets read from a file as a fallback method.
179172
#[cfg(any(

0 commit comments

Comments
 (0)