diff --git a/.travis.yml b/.travis.yml index ba5d210..da8f451 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ matrix: env: FEATURES='use_collections' - rust: nightly env: FEATURES='use_alloc use_collections' + - rust: nightly + env: FEATURES='use_std use_alloc use_collections' script: - cargo build --features "$FEATURES" notifications: diff --git a/src/lib.rs b/src/lib.rs index 2641246..79717b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,12 @@ #![no_std] -#![cfg_attr(feature = "use_alloc", feature(alloc))] -#![cfg_attr(feature = "use_collections", feature(collections))] +#![cfg_attr(all(feature = "use_alloc", not(feature = "use_std")), feature(alloc))] +#![cfg_attr(all(feature = "use_collections", not(feature = "use_std")), feature(collections))] #[cfg(feature = "use_std")] extern crate std; -#[cfg(feature = "use_alloc")] +#[cfg(all(feature = "use_alloc", not(feature = "use_std")))] extern crate alloc; -#[cfg(feature = "use_collections")] +#[cfg(all(feature = "use_collections", not(feature = "use_std")))] extern crate collections; mod object; diff --git a/src/object.rs b/src/object.rs index 137a977..38daf22 100644 --- a/src/object.rs +++ b/src/object.rs @@ -3,11 +3,11 @@ use core::fmt; #[cfg(feature = "use_std")] use std::boxed::Box; -#[cfg(feature = "use_alloc")] +#[cfg(all(feature = "use_alloc", not(feature = "use_std")))] use alloc::boxed::Box; #[cfg(feature = "use_std")] use std::vec::Vec; -#[cfg(all(feature = "use_alloc", feature = "use_collections"))] +#[cfg(all(feature = "use_alloc", feature = "use_collections", not(feature = "use_std")))] use collections::vec::Vec; /// A managed object. diff --git a/src/slice.rs b/src/slice.rs index dc3c92c..7d60a85 100644 --- a/src/slice.rs +++ b/src/slice.rs @@ -3,7 +3,7 @@ use core::fmt; #[cfg(feature = "use_std")] use std::vec::Vec; -#[cfg(feature = "use_collections")] +#[cfg(all(feature = "use_collections", not(feature = "use_std")))] use collections::vec::Vec; /// A managed slice.