diff options
author | 2019-07-28 00:12:20 +0000 | |
---|---|---|
committer | 2019-07-28 00:12:20 +0000 | |
commit | 6a213910f7f8920906c2f8882cbc1f1a3ebc3627 (patch) | |
tree | 6a00284e3ec74521ee278a0ce507e13d61123bf3 | |
parent | 0788bd9226831d2748b16d300a212981b61aa7c9 (diff) | |
parent | 548670a2087e7b88f7951aa84b761efee869869c (diff) | |
download | cortex-m-6a213910f7f8920906c2f8882cbc1f1a3ebc3627.tar.gz cortex-m-6a213910f7f8920906c2f8882cbc1f1a3ebc3627.tar.zst cortex-m-6a213910f7f8920906c2f8882cbc1f1a3ebc3627.zip |
Merge #159
159: Define MSRV to be 1.31.0 and unconditionally use const-fn r=therealprof a=adamgreig
As per https://github.com/rust-embedded/wg/blob/master/ops/msrv.md we should have a defined MSRV for this crate. This PR proposes setting it to 1.31 to allow use of `const-fn` from bare-metal by default, and updates `Cargo.toml` accordingly. It also sets the edition to 2018, permitted by an MSRV of 1.31.
Since this PR _introduces_ an MSRV I propose it not requiring a semver bump, and we instead would look to release this change as `0.6.1`.
Closes #153.
Co-authored-by: Adam Greig <adam@ael.co.uk>
Co-authored-by: Adam Greig <adam@adamgreig.com>
-rw-r--r-- | .travis.yml | 20 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | ci/script.sh | 4 | ||||
-rw-r--r-- | src/lib.rs | 7 |
4 files changed, 27 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 1aead9b..1497c7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,26 @@ matrix: rust: stable if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) + # MSRV + - env: TARGET=thumbv6m-none-eabi + rust: 1.31.0 + if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) + + # MSRV + - env: TARGET=thumbv7m-none-eabi + rust: 1.31.0 + if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) + + # MSRV + - env: TARGET=thumbv7em-none-eabi + rust: 1.31.0 + if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) + + # MSRV + - env: TARGET=thumbv7em-none-eabihf + rust: 1.31.0 + if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) + - env: TARGET=thumbv6m-none-eabi rust: nightly if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) @@ -16,10 +16,10 @@ links = "cortex-m" # prevent multiple versions of this crate to be linked toget [dependencies] aligned = "0.3.1" -bare-metal = "0.2.0" +bare-metal = { version = "0.2.0", features = ["const-fn"] } volatile-register = "0.2.0" [features] +const-fn = [] cm7-r0p1 = [] -const-fn = ["bare-metal/const-fn"] inline-asm = [] diff --git a/ci/script.sh b/ci/script.sh index 20a8ea2..8046774 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -8,7 +8,7 @@ main() { cargo check --target $TARGET if [ $TRAVIS_RUST_VERSION = nightly ]; then - cargo check --target $TARGET --features 'const-fn inline-asm' + cargo check --target $TARGET --features 'inline-asm' fi case $TARGET in @@ -16,7 +16,7 @@ main() { cargo check --target $TARGET --features cm7-r0p1 if [ $TRAVIS_RUST_VERSION = nightly ]; then - cargo check --target $TARGET --features 'cm7-r0p1 const-fn inline-asm' + cargo check --target $TARGET --features 'cm7-r0p1 inline-asm' fi ;; @@ -24,11 +24,10 @@ //! //! The disadvantage is that `inline-asm` requires a nightly toolchain. //! -//! ## `const-fn` +//! # Minimum Supported Rust Version (MSRV) //! -//! Enabling this feature turns the `Mutex.new` constructor into a `const fn`. -//! -//! This feature requires a nightly toolchain. +//! This crate is guaranteed to compile on stable Rust 1.31 and up. It *might* +//! compile with older versions but that may change in any new patch release. #![cfg_attr(feature = "inline-asm", feature(asm))] #![deny(missing_docs)] |