diff --git a/Cargo.toml b/Cargo.toml index 4b92287..1c4c208 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,5 @@ name = "bare-metal" repository = "https://github.com/japaric/bare-metal" version = "0.2.4" -[features] -const-fn = [] - [build-dependencies] rustc_version = "0.2.3" diff --git a/ci/script.sh b/ci/script.sh index 076bd67..b0aec22 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -3,10 +3,6 @@ set -euxo pipefail main() { cargo check --target $TARGET - if [ $TRAVIS_RUST_VERSION = nightly ]; then - cargo check --target $TARGET --features const-fn - fi - if [ $TARGET = x86_64-unknown-linux-gnu ]; then cargo test fi diff --git a/src/lib.rs b/src/lib.rs index 8b8efeb..47a6b8e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,10 +2,6 @@ #![deny(missing_docs)] #![deny(warnings)] -#![cfg_attr( - all(feature = "const-fn", unstable_const_fn), - feature(const_fn) -)] #![no_std] use core::cell::UnsafeCell; @@ -23,23 +19,12 @@ impl Peripheral { /// Creates a new peripheral /// /// `address` is the base address of the register block - #[cfg(feature = "const-fn")] pub const unsafe fn new(address: usize) -> Self { Peripheral { address: address as *mut T, } } - /// Creates a new peripheral - /// - /// `address` is the base address of the register block - #[cfg(not(feature = "const-fn"))] - pub unsafe fn new(address: usize) -> Self { - Peripheral { - address: address as *mut T, - } - } - /// Borrows the peripheral for the duration of a critical section pub fn borrow<'cs>(&self, _ctxt: &'cs CriticalSection) -> &'cs T { unsafe { &*self.get() } @@ -81,20 +66,11 @@ pub struct Mutex { impl Mutex { /// Creates a new mutex - #[cfg(feature = "const-fn")] pub const fn new(value: T) -> Self { Mutex { inner: UnsafeCell::new(value), } } - - /// Creates a new mutex - #[cfg(not(feature = "const-fn"))] - pub fn new(value: T) -> Self { - Mutex { - inner: UnsafeCell::new(value), - } - } } impl Mutex {