From: Tilman Sauerbeck Date: Mon, 24 Jun 2019 04:23:00 +0000 (+0200) Subject: common: Define panic handler using the #[panic_handler] attribute. X-Git-Url: http://git.code-monkey.de/?p=gps-watch.git;a=commitdiff_plain;h=db503888f59640eb469880cdbb5dbf873569d072 common: Define panic handler using the #[panic_handler] attribute. This means we now require rust 1.30 for the build. --- 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 { } }