diff options
author | 2018-05-13 11:53:42 +0200 | |
---|---|---|
committer | 2018-05-13 12:00:49 +0200 | |
commit | 0e468eb30aa368319fa93d6266653477353efae1 (patch) | |
tree | ff8aafbff8ea9e0bcb6c2bbf67989ddcdcd6709c | |
parent | 7a0ba8063a181e1b8df9673fdd9e83d10c451678 (diff) | |
download | cortex-m-0e468eb30aa368319fa93d6266653477353efae1.tar.gz cortex-m-0e468eb30aa368319fa93d6266653477353efae1.tar.zst cortex-m-0e468eb30aa368319fa93d6266653477353efae1.zip |
add a "const-fn" feature
-rw-r--r-- | CHANGELOG.md | 11 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | ci/script.sh | 4 | ||||
-rw-r--r-- | src/lib.rs | 6 |
4 files changed, 22 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4453722..77236e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [v0.5.1] - 2018-05-13 + +### Added + +- An opt-in `"const-fn"` feature that makes `Mutex.new` constructor into a `const fn`. This feature + requires a nightly toolchain. + ## [v0.5.0] - 2018-05-11 ### Added @@ -44,6 +51,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [breaking-change] removed several fields from `cpuid::RegisterBlock` on ARMv6-M. These registers are not available on that sub-architecture. +- [breaking-change] The `Mutex.new` constructor is not a `const fn` by default. To make it a `const + fn` you have to opt into the `"const-fn"` feature, which was added in v0.5.1, and switch to a + nightly compiler. + ### Removed - [breaking-change] The `exception` module has been removed. A replacement for `Exception::active` @@ -7,7 +7,7 @@ keywords = ["arm", "cortex-m", "register", "peripheral"] license = "MIT OR Apache-2.0" name = "cortex-m" repository = "https://github.com/japaric/cortex-m" -version = "0.5.0" +version = "0.5.1" [build-dependencies] cc = "1.0.10" @@ -19,4 +19,5 @@ volatile-register = "0.2.0" [features] cm7-r0p1 = [] -inline-asm = [] +const-fn = ["bare-metal/const-fn"] +inline-asm = []
\ No newline at end of file diff --git a/ci/script.sh b/ci/script.sh index e017b54..9fd46a3 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -4,7 +4,7 @@ main() { cargo check --target $TARGET if [ $TRAVIS_RUST_VERSION = nightly ]; then - cargo check --target $TARGET --features inline-asm + cargo check --target $TARGET --features 'const-fn inline-asm' fi case $TARGET in @@ -12,7 +12,7 @@ main() { cargo check --target $TARGET --features cm7-r0p1 if [ $TRAVIS_RUST_VERSION = nightly ]; then - cargo check --target $TARGET --features 'cm7-r0p1 inline-asm' + cargo check --target $TARGET --features 'cm7-r0p1 const-fn inline-asm' fi ;; @@ -30,6 +30,12 @@ //! API docs for details. //! //! The disadvantage is that `inline-asm` requires a nightly toolchain. +//! +//! ## `const-fn` +//! +//! Enabling this feature turns the `Mutex.new` constructor into a `const fn`. +//! +//! This feature requires a nightly toolchain. #![cfg_attr(feature = "inline-asm", feature(asm))] #![deny(missing_docs)] |