From: Ralf Jung Date: Mon, 25 Nov 2019 11:14:23 +0000 (+0100) Subject: Rename continue_panic_fmt to panic_handler, and make it the #[panic_handler] directly X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=cd5d0c7b102d2573165efdbd2ffc31c4a5be3bb5;p=rust.git Rename continue_panic_fmt to panic_handler, and make it the #[panic_handler] directly The "continue" in the name was really confusing; it sounds way too much like "resume" which is a totally different concept around panics. --- diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 6819a4a04d7..a0f6183d514 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -296,14 +296,6 @@ pub fn panicking() -> bool { update_panic_count(0) != 0 } -/// Entry point of panic from the libcore crate (`panic_impl` lang item). -#[cfg(not(test))] -#[panic_handler] -#[unwind(allowed)] -pub fn rust_begin_panic(info: &PanicInfo<'_>) -> ! { - continue_panic_fmt(&info) -} - /// The entry point for panicking with a formatted message. /// /// This is designed to reduce the amount of code required at the call @@ -327,10 +319,13 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>, let (file, line, col) = *file_line_col; let location = Location::internal_constructor(file, line, col); let info = PanicInfo::internal_constructor(Some(msg), &location); - continue_panic_fmt(&info) + panic_handler(&info) } -fn continue_panic_fmt(info: &PanicInfo<'_>) -> ! { +/// Entry point of panic from the libcore crate (`panic_impl` lang item). +#[cfg_attr(not(test), panic_handler)] +#[unwind(allowed)] +fn panic_handler(info: &PanicInfo<'_>) -> ! { struct PanicPayload<'a> { inner: &'a fmt::Arguments<'a>, string: Option,