Skip to content

Commit 689771b

Browse files
authored
Only impl std traits if feature is specified (#106)
* Fix CI to allow for PRs against 0.2 to be run * Only impl std traits if feature is specified * Fix l4re
1 parent 5cfa668 commit 689771b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,4 @@ notifications:
197197
branches:
198198
only:
199199
- master
200+
- 0.2

src/lib.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,20 @@ 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+
#[cfg(all(
164+
unix,
165+
not(any(
166+
target_os = "ios",
167+
target_os = "fuchsia",
168+
target_os = "hermit",
169+
target_os = "l4re"
170+
))
171+
))]
172+
#[allow(dead_code)]
173+
mod util_libc;
174+
175+
#[cfg(feature = "std")]
176+
mod error_impls;
177177

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

0 commit comments

Comments
 (0)