diff options
| author | Ralf Jung <post@ralfj.de> | 2019-11-25 12:14:23 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-11-25 12:14:23 +0100 |
| commit | cd5d0c7b102d2573165efdbd2ffc31c4a5be3bb5 (patch) | |
| tree | 0eca0ae3976ccce23dc0846b699c701851475143 /src | |
| parent | 6440b9425384d2f8f11c4fe281fe99f79b92afb6 (diff) | |
| download | rust-cd5d0c7b102d2573165efdbd2ffc31c4a5be3bb5.tar.gz rust-cd5d0c7b102d2573165efdbd2ffc31c4a5be3bb5.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libstd/panicking.rs | 15 |
1 files changed, 5 insertions, 10 deletions
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<String>, |
