From f94b23ed1d308f7ca5d803d7a1639e168fcf55a1 Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Mon, 5 Nov 2018 20:20:24 +1300 Subject: [PATCH] Use the new panic handler feature The "panic_fmt" lang item no longer exists; it has been replaced with the unstable feature #[panic_handler] --- src/lib.rs | 1 + src/std_stub.rs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a474a88..7be2b49 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,7 @@ #![feature(associated_type_defaults)] #![feature(const_fn)] #![feature(lang_items)] +#![feature(panic_handler)] #![feature(unwind_attributes)] #![no_core] diff --git a/src/std_stub.rs b/src/std_stub.rs index 60bbb60..53cd096 100644 --- a/src/std_stub.rs +++ b/src/std_stub.rs @@ -7,10 +7,9 @@ pub mod std { pub unsafe extern "C" fn rust_eh_personality(_state: (), _exception_object: *mut (), _context: *mut ()) -> () { } - #[lang = "panic_fmt"] - #[unwind] - pub extern fn rust_begin_panic(_msg: (), _file: &'static str, _line: u32) -> ! { - loop { } + #[panic_handler] + fn panic(_info: &::core::panic::PanicInfo) -> ! { + loop {} } }