Skip to content

Commit

Permalink
Only impl std traits if feature is specified (#106)
Browse files Browse the repository at this point in the history
* Fix CI to allow for PRs against 0.2 to be run

* Only impl std traits if feature is specified

* Fix l4re
  • Loading branch information
josephlr committed Sep 21, 2019
1 parent fa6f929 commit 05b479a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,4 @@ notifications:
branches:
only:
- master
- 0.2
28 changes: 14 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ pub use crate::error::Error;
#[allow(dead_code)]
mod util;

cfg_if! {
// Unlike the other Unix, Fuchsia and iOS don't use the libc to make any calls.
if #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "emscripten",
target_os = "freebsd", target_os = "haiku", target_os = "illumos",
target_os = "linux", target_os = "macos", target_os = "netbsd",
target_os = "openbsd", target_os = "redox", target_os = "solaris"))] {
#[allow(dead_code)]
mod util_libc;
// Keep std-only trait definitions for backwards compatiblity
mod error_impls;
} else if #[cfg(feature = "std")] {
mod error_impls;
}
}
#[cfg(all(
unix,
not(any(
target_os = "ios",
target_os = "fuchsia",
target_os = "hermit",
target_os = "l4re"
))
))]
#[allow(dead_code)]
mod util_libc;

#[cfg(feature = "std")]
mod error_impls;

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

0 comments on commit 05b479a

Please sign in to comment.