From 9fb4dab070e4ec3363d8ece1347fcd09ef1d8f61 Mon Sep 17 00:00:00 2001 From: Stephen Demos Date: Sun, 3 Jun 2018 21:05:34 -0700 Subject: [PATCH] use panic_implementation instead of panic_fmt this change was merged in rust-lang/rust#50338. --- uefi-services/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uefi-services/src/lib.rs b/uefi-services/src/lib.rs index 9ce33aa0e..cb3e241a9 100644 --- a/uefi-services/src/lib.rs +++ b/uefi-services/src/lib.rs @@ -12,6 +12,7 @@ #![no_std] #![feature(lang_items)] +#![feature(panic_implementation)] // These crates are required. extern crate rlibc; @@ -93,12 +94,11 @@ fn init_alloc() { #[lang = "eh_personality"] fn eh_personality() {} -#[lang = "panic_fmt"] -#[no_mangle] -pub fn panic_fmt(_fmt: core::fmt::Arguments, file_line_col: &(&'static str, u32, u32)) { - let &(file, line, column) = file_line_col; - - error!("Panic in {} at ({}, {})", file, line, column); +#[panic_implementation] +fn panic_fmt(info: &core::panic::PanicInfo) -> ! { + if let Some(location) = info.location() { + error!("Panic in {} at ({}, {})", location.file(), location.line(), location.column()); + } loop { // TODO: add a timeout then shutdown.