From db503888f59640eb469880cdbb5dbf873569d072 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 24 Jun 2019 06:23:00 +0200 Subject: [PATCH] common: Define panic handler using the #[panic_handler] attribute. This means we now require rust 1.30 for the build. --- src/common/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/common/lib.rs b/src/common/lib.rs index c262abd..34522e8 100644 --- a/src/common/lib.rs +++ b/src/common/lib.rs @@ -24,20 +24,17 @@ #![no_std] #![crate_name="common"] #![crate_type="rlib"] -#![feature(lang_items)] pub mod register; pub mod nvic; pub mod clock; pub mod usb_serial; -#[lang="eh_personality"] -extern fn eh_personality() { -} +use core::panic::PanicInfo; -#[lang="panic_fmt"] -#[no_mangle] -pub fn rust_begin_unwind(_fmt: &core::fmt::Arguments, _file_line: &(&'static str, usize)) -> ! { +#[inline(never)] +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { loop { } } -- 2.30.2