120: Allow for manual opt-out of CAS features r=japaric a=jamesmunns

I've been working on a bare metal platform lately that does not have CAS (specifically ARMv4 bare metal), and this is not caught by the CPU detection logic in the build.rs. This PR adds a flag that allows for manual specification to avoid CAS features.

Co-authored-by: James Munns <james.munns@ferrous-systems.com>
This commit is contained in:
bors[bot] 2019-12-18 10:52:17 +00:00 committed by GitHub
commit 909251de32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -19,6 +19,12 @@ name = "heapless"
repository = "https://github.com/japaric/heapless"
version = "0.5.1"
[features]
default = ["cas"]
cas = []
# only for tests
__trybuild = []
[target.x86_64-unknown-linux-gnu.dev-dependencies]
scoped_threadpool = "0.1.8"
@ -31,7 +37,3 @@ hash32 = "0.1.0"
version = "1"
optional = true
default-features = false
[features]
# only for tests
__trybuild = []

View File

@ -89,9 +89,9 @@ mod ser;
pub mod binary_heap;
pub mod i;
#[cfg(not(armv6m))]
#[cfg(all(not(armv6m), feature = "cas"))]
pub mod mpmc;
#[cfg(not(armv6m))]
#[cfg(all(not(armv6m), feature = "cas"))]
pub mod pool;
pub mod spsc;

View File

@ -154,7 +154,6 @@
//!
//! [1]: https://static.docs.arm.com/ddi0403/eb/DDI0403E_B_armv7m_arm.pdf
#[cfg(not(armv6m))]
use core::{any::TypeId, mem, sync::atomic::Ordering};
use core::{
cell::UnsafeCell,