diff options
author | 2018-10-26 19:12:42 +0000 | |
---|---|---|
committer | 2018-10-26 19:12:42 +0000 | |
commit | 3d4361409a94774c960e4c95007a8740d558506b (patch) | |
tree | c7bbb7dcd95508dd34fe7c558a67f230d5d9b25c /cortex-m-rt/macros/src | |
parent | c5d24f867d7d4f4f270ba99eef89f97cf38a4445 (diff) | |
parent | 0f7ee4c83de809b46e2c0c78619ec1bad429aa0e (diff) | |
download | cortex-m-3d4361409a94774c960e4c95007a8740d558506b.tar.gz cortex-m-3d4361409a94774c960e4c95007a8740d558506b.tar.zst cortex-m-3d4361409a94774c960e4c95007a8740d558506b.zip |
Merge #141
141: entry/exception/interrupt: reachability restriction is 1.30-only r=therealprof a=japaric
Thanks to rust-lang/rust#54451, which will be available in 1.31, these
attributes will work regardless of the visibility and reachability of the items.
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'cortex-m-rt/macros/src')
-rw-r--r-- | cortex-m-rt/macros/src/lib.rs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs index dd89f06..0d29f55 100644 --- a/cortex-m-rt/macros/src/lib.rs +++ b/cortex-m-rt/macros/src/lib.rs @@ -22,9 +22,10 @@ use proc_macro::TokenStream; /// Attribute to declare the entry point of the program /// -/// **IMPORTANT**: This attribute must be used once in the dependency graph and must be used on a -/// reachable item (i.e. there must be no private modules between the item and the root of the -/// crate). If the item is in the root of the crate you'll be fine. +/// **IMPORTANT**: This attribute must appear exactly *once* in the dependency graph. Also, if you +/// are using Rust 1.30 the attribute must be used on a reachable item (i.e. there must be no +/// private modules between the item and the root of the crate); if the item is in the root of the +/// crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 and newer releases. /// /// The specified function will be called by the reset handler *after* RAM has been initialized. In /// the case of the `thumbv7em-none-eabihf` target the FPU will also be enabled before the function @@ -142,9 +143,10 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { /// Attribute to declare an exception handler /// -/// **IMPORTANT**: This attribute must be used on reachable items (i.e. there must be no private -/// modules between the item and the root of the crate). If the item is in the root of the crate -/// you'll be fine. +/// **IMPORTANT**: If you are using Rust 1.30 this attribute must be used on reachable items (i.e. +/// there must be no private modules between the item and the root of the crate); if the item is in +/// the root of the crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 +/// and newer releases. /// /// # Syntax /// @@ -436,9 +438,10 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream { /// Attribute to declare an interrupt (AKA device-specific exception) handler /// -/// **IMPORTANT**: This attribute must be used on reachable items (i.e. there must be no private -/// modules between the item and the root of the crate). If the item is in the root of the crate -/// you'll be fine. +/// **IMPORTANT**: If you are using Rust 1.30 this attribute must be used on reachable items (i.e. +/// there must be no private modules between the item and the root of the crate); if the item is in +/// the root of the crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 +/// and newer releases. /// /// **NOTE**: This attribute is exposed by `cortex-m-rt` only when the `device` feature is enabled. /// However, that export is not meant to be used directly -- using it will result in a compilation @@ -575,9 +578,11 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream { /// Attribute to mark which function will be called at the beginning of the reset handler. /// -/// **IMPORTANT**: This attribute must be used once in the dependency graph and must be used on a -/// reachable item (i.e. there must be no private modules between the item and the root of the -/// crate). If the item is in the root of the crate you'll be fine. +/// **IMPORTANT**: This attribute can appear at most *once* in the dependency graph. Also, if you +/// are using Rust 1.30 the attribute must be used on a reachable item (i.e. there must be no +/// private modules between the item and the root of the crate); if the item is in the root of the +/// crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 and newer +/// releases. /// /// The function must have the signature of `unsafe fn()`. /// |