Skip to content

Commit cd5d0c7

Browse files
committed
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.
1 parent 6440b94 commit cd5d0c7

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/libstd/panicking.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,6 @@ pub fn panicking() -> bool {
296296
update_panic_count(0) != 0
297297
}
298298

299-
/// Entry point of panic from the libcore crate (`panic_impl` lang item).
300-
#[cfg(not(test))]
301-
#[panic_handler]
302-
#[unwind(allowed)]
303-
pub fn rust_begin_panic(info: &PanicInfo<'_>) -> ! {
304-
continue_panic_fmt(&info)
305-
}
306-
307299
/// The entry point for panicking with a formatted message.
308300
///
309301
/// 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<'_>,
327319
let (file, line, col) = *file_line_col;
328320
let location = Location::internal_constructor(file, line, col);
329321
let info = PanicInfo::internal_constructor(Some(msg), &location);
330-
continue_panic_fmt(&info)
322+
panic_handler(&info)
331323
}
332324

333-
fn continue_panic_fmt(info: &PanicInfo<'_>) -> ! {
325+
/// Entry point of panic from the libcore crate (`panic_impl` lang item).
326+
#[cfg_attr(not(test), panic_handler)]
327+
#[unwind(allowed)]
328+
fn panic_handler(info: &PanicInfo<'_>) -> ! {
334329
struct PanicPayload<'a> {
335330
inner: &'a fmt::Arguments<'a>,
336331
string: Option<String>,

0 commit comments

Comments
 (0)