From 035ecb565cd622fa0bf200ed01e6e59fe826443a Mon Sep 17 00:00:00 2001 From: Pontus Andersson Date: Tue, 5 Nov 2024 10:35:26 +0100 Subject: [PATCH 1/3] Make have_basepri an expected cfg Since Rust 1.80 there is automatic compile-time checks for unexpected cfgs. Ensure that `have_basepri` cfg is known by the compiler emitting it in the build.rs. --- CHANGELOG.md | 2 ++ build.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d17227813a5a..ca7be67ee906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Fixed +- CFG: Make `have_basepri` an expected cfg + ### Changed ## [v1.1.4] - 2023-02-26 diff --git a/build.rs b/build.rs index ff9ebe35e7ff..ac284c4ecfb6 100644 --- a/build.rs +++ b/build.rs @@ -7,6 +7,9 @@ fn main() { println!("cargo:rustc-cfg=rustc_is_nightly"); } + // Make `have_basepri` an expected cfg. + println!("cargo::rustc-check-cfg=cfg(have_basepri)"); + // These targets all have know support for the BASEPRI register. if target.starts_with("thumbv7m") | target.starts_with("thumbv7em") From 15bbbdad9a2b5d94345142bd76a593215529646c Mon Sep 17 00:00:00 2001 From: Pontus Andersson Date: Tue, 5 Nov 2024 11:10:41 +0100 Subject: [PATCH 2/3] Make clippy happy Fix doc list indentation lint[1] and ignore `new_without_default`[2]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [2]: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default --- src/export.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/export.rs b/src/export.rs index 6f2a1b63c188..71e83411f5da 100644 --- a/src/export.rs +++ b/src/export.rs @@ -88,6 +88,7 @@ pub struct Barrier { } impl Barrier { + #[allow(clippy::new_without_default)] pub const fn new() -> Self { Barrier { inner: AtomicBool::new(false), @@ -264,7 +265,7 @@ pub unsafe fn lock( /// - we execute the closure in a global critical section (interrupt free) /// - CS entry cost, single write to core register /// - CS exit cost, single write to core register -/// else +/// - else /// - The `mask` value is folded to a constant at compile time /// - CS entry, single write of the 32 bit `mask` to the `icer` register /// - CS exit, single write of the 32 bit `mask` to the `iser` register From e24b2190616f4971ab5808072bb7840cb574f974 Mon Sep 17 00:00:00 2001 From: Pontus Andersson Date: Mon, 4 Nov 2024 08:39:52 +0100 Subject: [PATCH 3/3] Remove unused crate proc-macro-error The `proc-macro-error` crate is unmaintained[1] and is causing `cargo audit` failures[1]. Since the create is not even used by `rtic`, just remove it as a dependency. [1]: https://rustsec.org/advisories/RUSTSEC-2024-0370.html --- CHANGELOG.md | 1 + Cargo.toml | 2 +- macros/Cargo.toml | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca7be67ee906..f6e61b1c4784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Fixed - CFG: Make `have_basepri` an expected cfg +- Removed unused `proc-macro-error` crate from dependencies ### Changed diff --git a/Cargo.toml b/Cargo.toml index 68fea4cb2cf2..d764e327e54a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ name = "rtic" [dependencies] cortex-m = "0.7.0" -cortex-m-rtic-macros = { path = "macros", version = "1.1.6" } +cortex-m-rtic-macros = { path = "macros", version = "1.1.7" } rtic-monotonic = "1.0.0" rtic-core = "1.0.0" heapless = "0.7.7" diff --git a/macros/Cargo.toml b/macros/Cargo.toml index c3f05614856c..6786130b955e 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -12,14 +12,13 @@ license = "MIT OR Apache-2.0" name = "cortex-m-rtic-macros" readme = "../README.md" repository = "https://github.com/rtic-rs/cortex-m-rtic" -version = "1.1.6" +version = "1.1.7" [lib] proc-macro = true [dependencies] proc-macro2 = "1" -proc-macro-error = "1" quote = "1" syn = "1" rtic-syntax = "1.0.3"