Skip to content

Commit 77d205c

Browse files
committed
doc: Remove obsolete references to entry!
1 parent a404363 commit 77d205c

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

cortex-m-rt/examples/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Directly plug a `main` symbol instead of using `entry!`
1+
//! Directly plug a `main` symbol instead of using `#[entry]`
22
33
#![deny(warnings)]
44
#![no_main]

cortex-m-rt/src/lib.rs

+7-20
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@
194194
//! One will always find the following (unmangled) symbols in `cortex-m-rt` applications:
195195
//!
196196
//! - `Reset`. This is the reset handler. The microcontroller will executed this function upon
197-
//! booting. This function will call the user program entry point (cf. [`entry!`]) using the `main`
197+
//! booting. This function will call the user program entry point (cf. [`#[entry]`]) using the `main`
198198
//! symbol so you may also find that symbol in your program; if you do, `main` will contain your
199199
//! application code. Some other times `main` gets inlined into `Reset` so you won't find it.
200200
//!
201-
//! [`entry!`]: macro.entry.html
201+
//! [`#[entry]`]: https://docs.rs/cortex-m-rt-macros/0.1.5/cortex_m_rt_macros/attr.entry.html
202202
//!
203203
//! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn
204204
//! DefaultHandler(..` this will be an infinite loop.
@@ -245,26 +245,13 @@
245245
//!
246246
//! ## Setting the program entry point
247247
//!
248-
//! This section describes how `entry!` is implemented. This information is useful to developers who
249-
//! want to provide an alternative to `entry!` that provides extra guarantees.
248+
//! This section describes how `#[entry]` is implemented. This information is useful to developers who
249+
//! want to provide an alternative to `#[entry]` that provides extra guarantees.
250250
//!
251251
//! The `Reset` handler will call a symbol named `main` (unmangled) *after* initializing `.bss` and
252-
//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). `entry!` provides this
253-
//! symbol in its expansion:
254-
//!
255-
//! ``` ignore
256-
//! entry!(path::to::main);
257-
//!
258-
//! // expands into
259-
//!
260-
//! #[export_name = "main"]
261-
//! pub extern "C" fn __impl_main() -> ! {
262-
//! // validate the signature of the program entry point
263-
//! let f: fn() -> ! = path::to::main;
264-
//!
265-
//! f()
266-
//! }
267-
//! ```
252+
//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). A function with the
253+
//! `entry` attribute will be set to have the export name "`main`"; in addition, its mutable
254+
//! statics are turned into safe mutable references (see [`#[entry]`] for details).
268255
//!
269256
//! The unmangled `main` symbol must have signature `extern "C" fn() -> !` or its invocation from
270257
//! `Reset` will result in undefined behavior.

0 commit comments

Comments
 (0)