Skip to content

Commit 58c876c

Browse files
bors[bot]japaric
andcommitted
Merge #14
14: make the const-fn feature work in 1.31(-beta) r=japaric a=japaric Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents 0c8f10e + c26df6e commit 58c876c

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased]
77

8+
## [v0.2.4] - 2018-10-30
9+
10+
### Added
11+
12+
- Note in the documentation that `Mutex` is not memory safe in multi-core systems.
13+
14+
### Changed
15+
16+
- The `const-fn` feature can now be used on 1.31-beta and will also work on stable 1.31.
17+
818
## [v0.2.3] - 2018-08-17
919

1020
### Fixed

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ keywords = ["bare-metal", "register", "peripheral", "interrupt"]
77
license = "MIT OR Apache-2.0"
88
name = "bare-metal"
99
repository = "https://github.com/japaric/bare-metal"
10-
version = "0.2.3"
10+
version = "0.2.4"
1111

1212
[features]
13-
const-fn = []
13+
const-fn = []
14+
15+
[build-dependencies]
16+
rustc_version = "0.2.3"

build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extern crate rustc_version;
2+
3+
fn main() {
4+
let vers = rustc_version::version().unwrap();
5+
6+
if vers.major == 1 && vers.minor < 31 {
7+
println!("cargo:rustc-cfg=unstable_const_fn")
8+
}
9+
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![deny(missing_docs)]
44
#![deny(warnings)]
55
#![cfg_attr(
6-
feature = "const-fn",
6+
all(feature = "const-fn", unstable_const_fn),
77
feature(const_fn)
88
)]
99
#![no_std]

0 commit comments

Comments
 (0)