Skip to content

Commit 37de64a

Browse files
committed
Remove references to unsupported Rust versions in cortex-m-rt
1 parent 7813e4d commit 37de64a

File tree

1 file changed

+9
-40
lines changed

1 file changed

+9
-40
lines changed

cortex-m-rt/src/lib.rs

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,10 @@
322322
//!
323323
//! We want to provide a default handler for all the interrupts while still letting the user
324324
//! individually override each interrupt handler. In C projects, this is usually accomplished using
325-
//! weak aliases declared in external assembly files. In Rust, we could achieve something similar
326-
//! using `global_asm!`, but that's an unstable feature.
327-
//!
328-
//! A solution that doesn't require `global_asm!` or external assembly files is to use the `PROVIDE`
329-
//! command in a linker script to create the weak aliases. This is the approach that `cortex-m-rt`
330-
//! uses; when the `"device"` feature is enabled `cortex-m-rt`'s linker script (`link.x`) depends on
331-
//! a linker script named `device.x`. The crate that provides `__INTERRUPTS` must also provide this
332-
//! file.
325+
//! weak aliases declared in external assembly files. We use a similar solution via the `PROVIDE`
326+
//! command in the linker script: when the `"device"` feature is enabled, `cortex-m-rt`'s linker
327+
//! script (`link.x`) includes a linker script named `device.x`, which must be provided by
328+
//! whichever crate provides `__INTERRUPTS`.
333329
//!
334330
//! For our running example the `device.x` linker script looks like this:
335331
//!
@@ -343,8 +339,8 @@
343339
//! that the core exceptions use unless overridden.
344340
//!
345341
//! Because this linker script is provided by a dependency of the final application the dependency
346-
//! must contain build script that puts `device.x` somewhere the linker can find. An example of such
347-
//! build script is shown below:
342+
//! must contain a build script that puts `device.x` somewhere the linker can find. An example of
343+
//! such build script is shown below:
348344
//!
349345
//! ```ignore
350346
//! use std::env;
@@ -586,11 +582,6 @@ cfg_global_asm! {
586582

587583
/// Attribute to declare an interrupt (AKA device-specific exception) handler
588584
///
589-
/// **IMPORTANT**: If you are using Rust 1.30 this attribute must be used on reachable items (i.e.
590-
/// there must be no private modules between the item and the root of the crate); if the item is in
591-
/// the root of the crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31
592-
/// and newer releases.
593-
///
594585
/// **NOTE**: This attribute is exposed by `cortex-m-rt` only when the `device` feature is enabled.
595586
/// However, that export is not meant to be used directly -- using it will result in a compilation
596587
/// error. You should instead use the device crate (usually generated using `svd2rust`) re-export of
@@ -657,11 +648,6 @@ pub use macros::interrupt;
657648

658649
/// Attribute to declare the entry point of the program
659650
///
660-
/// **IMPORTANT**: This attribute must appear exactly *once* in the dependency graph. Also, if you
661-
/// are using Rust 1.30 the attribute must be used on a reachable item (i.e. there must be no
662-
/// private modules between the item and the root of the crate); if the item is in the root of the
663-
/// crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 and newer releases.
664-
///
665651
/// The specified function will be called by the reset handler *after* RAM has been initialized. In
666652
/// the case of the `thumbv7em-none-eabihf` target the FPU will also be enabled before the function
667653
/// is called.
@@ -716,11 +702,6 @@ pub use macros::entry;
716702

717703
/// Attribute to declare an exception handler
718704
///
719-
/// **IMPORTANT**: If you are using Rust 1.30 this attribute must be used on reachable items (i.e.
720-
/// there must be no private modules between the item and the root of the crate); if the item is in
721-
/// the root of the crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31
722-
/// and newer releases.
723-
///
724705
/// # Syntax
725706
///
726707
/// ```
@@ -832,11 +813,7 @@ pub use macros::exception;
832813

833814
/// Attribute to mark which function will be called at the beginning of the reset handler.
834815
///
835-
/// **IMPORTANT**: This attribute can appear at most *once* in the dependency graph. Also, if you
836-
/// are using Rust 1.30 the attribute must be used on a reachable item (i.e. there must be no
837-
/// private modules between the item and the root of the crate); if the item is in the root of the
838-
/// crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 and newer
839-
/// releases.
816+
/// **IMPORTANT**: This attribute can appear at most *once* in the dependency graph.
840817
///
841818
/// The function must have the signature of `unsafe fn()`.
842819
///
@@ -1071,21 +1048,13 @@ pub static __RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
10711048
#[cfg_attr(cortex_m, link_section = ".HardFault.default")]
10721049
#[no_mangle]
10731050
pub unsafe extern "C" fn HardFault_(ef: &ExceptionFrame) -> ! {
1074-
loop {
1075-
// add some side effect to prevent this from turning into a UDF instruction
1076-
// see rust-lang/rust#28728 for details
1077-
atomic::compiler_fence(Ordering::SeqCst);
1078-
}
1051+
loop {}
10791052
}
10801053

10811054
#[doc(hidden)]
10821055
#[no_mangle]
10831056
pub unsafe extern "C" fn DefaultHandler_() -> ! {
1084-
loop {
1085-
// add some side effect to prevent this from turning into a UDF instruction
1086-
// see rust-lang/rust#28728 for details
1087-
atomic::compiler_fence(Ordering::SeqCst);
1088-
}
1057+
loop {}
10891058
}
10901059

10911060
#[doc(hidden)]

0 commit comments

Comments
 (0)