From 2c14c9bce3b22462cce982258ddecb53df16ab49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Fri, 18 Feb 2022 15:11:55 +0100 Subject: [PATCH] rtic::mutex::prelude::* fixes glob import lint rtic-core Mutex, Exclusive and multi-lock retained in old location to not be backwards breaking --- CHANGELOG.md | 1 + macros/src/codegen/hardware_tasks.rs | 2 +- macros/src/codegen/idle.rs | 2 +- macros/src/codegen/software_tasks.rs | 2 +- src/lib.rs | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bd1829d76..576bc6039d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Re-export `rtic_core::prelude` as `rtic::mutex::prelude` to allow glob imports + Clippy - Fix dated migration docs for spawn - Force mdBook to return error codes - Readded missing ramfunc output to book diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index e6192e2c00..f75c71d43f 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -97,7 +97,7 @@ pub fn codegen( #[allow(non_snake_case)] fn #name(#context: #name::Context) { use rtic::Mutex as _; - use rtic::mutex_prelude::*; + use rtic::mutex::prelude::*; #(#stmts)* } diff --git a/macros/src/codegen/idle.rs b/macros/src/codegen/idle.rs index 0dededa4e6..83b85d7ba6 100644 --- a/macros/src/codegen/idle.rs +++ b/macros/src/codegen/idle.rs @@ -68,7 +68,7 @@ pub fn codegen( #[allow(non_snake_case)] fn #name(#context: #name::Context) -> ! { use rtic::Mutex as _; - use rtic::mutex_prelude::*; + use rtic::mutex::prelude::*; #(#stmts)* } diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index c767032f5c..0357003f26 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -131,7 +131,7 @@ pub fn codegen( #[allow(non_snake_case)] fn #name(#context: #name::Context #(,#inputs)*) { use rtic::Mutex as _; - use rtic::mutex_prelude::*; + use rtic::mutex::prelude::*; #(#stmts)* } diff --git a/src/lib.rs b/src/lib.rs index 25f93999dd..d3195a6346 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,6 +42,11 @@ pub use cortex_m_rtic_macros::app; pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex}; pub use rtic_monotonic::{self, Monotonic}; +/// module `mutex::prelude` provides `Mutex` and multi-lock variants. Recommended over `mutex_prelude` +pub mod mutex { + pub use rtic_core::prelude; +} + #[doc(hidden)] pub mod export; #[doc(hidden)]