]> git.lizzy.rs Git - rust.git/commitdiff
Rename continue_panic_fmt to panic_handler, and make it the #[panic_handler] directly
authorRalf Jung <post@ralfj.de>
Mon, 25 Nov 2019 11:14:23 +0000 (12:14 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 25 Nov 2019 11:14:23 +0000 (12:14 +0100)
The "continue" in the name was really confusing; it sounds way too much like "resume" which is a totally different concept around panics.

src/libstd/panicking.rs

index 6819a4a04d73770ebb30d18c101b8098902a7b8d..a0f6183d514ea0ee55731f1983915662a16f3912 100644 (file)
@@ -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<String>,