From 18557e748642fa960db44cb3143ee948f94cf990 Mon Sep 17 00:00:00 2001 From: Sergey Matyukevich Date: Tue, 9 Jul 2019 23:15:49 +0300 Subject: [PATCH] concurrency: add note about const-fn feature in cortex-m crate At the moment cortex-m crate hides const versions of some functions, including Mutex::new(), behind the const-fn feature. So this feature needs to be enabled to cortex-m in Cargo.toml for shared resource examples. Signed-off-by: Sergey Matyukevich --- src/concurrency/index.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/concurrency/index.md b/src/concurrency/index.md index 057818e..a4393c5 100644 --- a/src/concurrency/index.md +++ b/src/concurrency/index.md @@ -555,6 +555,23 @@ fn timer() { ``` +> **NOTE** +> +> At the moment `cortex-m` crate hides const versions of some functions +> (including `Mutex::new()`) behind the `const-fn` feature. So you need to add +> the `const-fn` feature to dependency on cortex-m in Cargo.toml to make +> the above examples work: +> +> ``` toml +> [dependencies.cortex-m] +> version="0.6.0" +> features=["const-fn"] +> ``` +> Meanwhile `const-fn` has been working on stable Rust for some time now. +> So this additional switch in Cargo.toml will not be needed as soon as +> it is enabled in `cortex-m` by defauilt. +> + Whew! This is safe, but it is also a little unwieldy. Is there anything else we can do?