Skip to content

Commit 6a21391

Browse files
bors[bot]adamgreig
andcommitted
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 <[email protected]> Co-authored-by: Adam Greig <[email protected]>
2 parents 0788bd9 + 548670a commit 6a21391

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ matrix:
2222
rust: stable
2323
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
2424

25+
# MSRV
26+
- env: TARGET=thumbv6m-none-eabi
27+
rust: 1.31.0
28+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
29+
30+
# MSRV
31+
- env: TARGET=thumbv7m-none-eabi
32+
rust: 1.31.0
33+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
34+
35+
# MSRV
36+
- env: TARGET=thumbv7em-none-eabi
37+
rust: 1.31.0
38+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
39+
40+
# MSRV
41+
- env: TARGET=thumbv7em-none-eabihf
42+
rust: 1.31.0
43+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
44+
2545
- env: TARGET=thumbv6m-none-eabi
2646
rust: nightly
2747
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ links = "cortex-m" # prevent multiple versions of this crate to be linked toget
1616

1717
[dependencies]
1818
aligned = "0.3.1"
19-
bare-metal = "0.2.0"
19+
bare-metal = { version = "0.2.0", features = ["const-fn"] }
2020
volatile-register = "0.2.0"
2121

2222
[features]
23+
const-fn = []
2324
cm7-r0p1 = []
24-
const-fn = ["bare-metal/const-fn"]
2525
inline-asm = []

ci/script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ main() {
88
cargo check --target $TARGET
99

1010
if [ $TRAVIS_RUST_VERSION = nightly ]; then
11-
cargo check --target $TARGET --features 'const-fn inline-asm'
11+
cargo check --target $TARGET --features 'inline-asm'
1212
fi
1313

1414
case $TARGET in
1515
thumbv7em-none-eabi*)
1616
cargo check --target $TARGET --features cm7-r0p1
1717

1818
if [ $TRAVIS_RUST_VERSION = nightly ]; then
19-
cargo check --target $TARGET --features 'cm7-r0p1 const-fn inline-asm'
19+
cargo check --target $TARGET --features 'cm7-r0p1 inline-asm'
2020
fi
2121
;;
2222

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
//!
2525
//! The disadvantage is that `inline-asm` requires a nightly toolchain.
2626
//!
27-
//! ## `const-fn`
27+
//! # Minimum Supported Rust Version (MSRV)
2828
//!
29-
//! Enabling this feature turns the `Mutex.new` constructor into a `const fn`.
30-
//!
31-
//! This feature requires a nightly toolchain.
29+
//! This crate is guaranteed to compile on stable Rust 1.31 and up. It *might*
30+
//! compile with older versions but that may change in any new patch release.
3231
3332
#![cfg_attr(feature = "inline-asm", feature(asm))]
3433
#![deny(missing_docs)]

0 commit comments

Comments
 (0)