aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/src/lang_items.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/src/lang_items.rs')
-rw-r--r--cortex-m-rt/src/lang_items.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/cortex-m-rt/src/lang_items.rs b/cortex-m-rt/src/lang_items.rs
index b154b5f..236b2bd 100644
--- a/cortex-m-rt/src/lang_items.rs
+++ b/cortex-m-rt/src/lang_items.rs
@@ -1,28 +1,14 @@
/// Default panic handler
+#[cfg(feature = "abort-on-panic")]
#[lang = "panic_fmt"]
-#[linkage = "weak"]
unsafe extern "C" fn panic_fmt(
- _args: ::core::fmt::Arguments,
- _file: &'static str,
- _line: u32,
+ _: ::core::fmt::Arguments,
+ _: &'static str,
+ _: u32,
) -> ! {
::core::intrinsics::abort()
}
-#[macro_export]
-macro_rules! panic_fmt {
- ($f:expr) => {
- #[export_name = "rust_begin_unwind"]
- pub unsafe extern "C" fn _panic_fmt(
- args: ::core::fmt::Arguments,
- file: &'static str,
- line: u32,
- ) -> ! {
- $f(args, file, line)
- }
- }
-}
-
/// Lang item required to make the normal `main` work in applications
// This is how the `start` lang item works:
// When `rustc` compiles a binary crate, it creates a `main` function that looks