Skip to content

Commit

Permalink
use panic_implementation instead of panic_fmt
Browse files Browse the repository at this point in the history
this change was merged in rust-lang/rust#50338.
  • Loading branch information
sdemos committed Jun 4, 2018
1 parent ebb82a8 commit 9fb4dab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions uefi-services/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#![no_std]

#![feature(lang_items)]
#![feature(panic_implementation)]

// These crates are required.
extern crate rlibc;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 9fb4dab

Please sign in to comment.