Skip to content

Instantly share code, notes, and snippets.

@habnabit
Created March 3, 2016 01:02
Show Gist options
  • Save habnabit/e576e0435be82667b518 to your computer and use it in GitHub Desktop.
Save habnabit/e576e0435be82667b518 to your computer and use it in GitHub Desktop.
#[cold] #[inline(never)]
pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, u32)) -> ! {
#[allow(improper_ctypes)]
extern {
#[lang = "panic_fmt"]
#[unwind]
fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: u32) -> !;
}
let (file, line) = *file_line;
unsafe { panic_impl(fmt, file, line) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment