Skip to content

Commit 31713ab

Browse files
committed
make the reachability requirement more **prominent**
since we can't statically check that it holds
1 parent 943edfa commit 31713ab

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cortex-m-rt/macros/src/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ use proc_macro::TokenStream;
1515

1616
/// Attribute to declare the entry point of the program
1717
///
18-
/// **NOTE** This macro must be invoked once and must be invoked from an accessible module, ideally
19-
/// from the root of the crate.
18+
/// **IMPORTANT**: This attribute must be used once in the dependency graph and must be used on a
19+
/// reachable item (i.e. there must be no private modules between the item and the root of the
20+
/// crate). If the item is in the root of the crate you'll be fine.
2021
///
2122
/// The specified function will be called by the reset handler *after* RAM has been initialized. In
2223
/// the case of the `thumbv7em-none-eabihf` target the FPU will also be enabled before the function
@@ -136,8 +137,9 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
136137

137138
/// Attribute to declare an exception handler
138139
///
139-
/// **NOTE** This macro must be invoked from an accessible module, ideally from the root of the
140-
/// crate.
140+
/// **IMPORTANT**: This attribute must be used on reachable items (i.e. there must be no private
141+
/// modules between the item and the root of the crate). If the item is in the root of the crate
142+
/// you'll be fine.
141143
///
142144
/// # Syntax
143145
///
@@ -429,6 +431,10 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
429431

430432
/// Attribute to mark which function will be called at the beginning of the reset handler.
431433
///
434+
/// **IMPORTANT**: This attribute must be used once in the dependency graph and must be used on a
435+
/// reachable item (i.e. there must be no private modules between the item and the root of the
436+
/// crate). If the item is in the root of the crate you'll be fine.
437+
///
432438
/// The function must have the signature of `unsafe fn()`.
433439
///
434440
/// The function passed will be called before static variables are initialized. Any access of static

0 commit comments

Comments
 (0)