@@ -775,9 +775,7 @@ fn rust_panic_with_hook( |
|
|
775 |
775 |
crate::sys::abort_internal(); |
776 |
776 |
} |
777 |
777 |
|
778 |
|
-let mut info = PanicInfo::internal_constructor(location, can_unwind, force_no_backtrace); |
779 |
|
-let hook = HOOK.read().unwrap_or_else(PoisonError::into_inner); |
780 |
|
-match *hook { |
|
778 |
+match *HOOK.read().unwrap_or_else(PoisonError::into_inner) { |
781 |
779 |
// Some platforms (like wasm) know that printing to stderr won't ever actually |
782 |
780 |
// print anything, and if that's the case we can skip the default |
783 |
781 |
// hook. Since string formatting happens lazily when calling `payload` |
@@ -786,15 +784,12 @@ fn rust_panic_with_hook( |
|
|
786 |
784 |
// formatting.) |
787 |
785 |
Hook::Default if panic_output().is_none() => {} |
788 |
786 |
Hook::Default => { |
789 |
|
- info.set_payload(payload.get()); |
790 |
|
-default_hook(&info); |
|
787 |
+default_hook(&PanicInfo::new(location, payload.get(), can_unwind, force_no_backtrace)); |
791 |
788 |
} |
792 |
789 |
Hook::Custom(ref hook) => { |
793 |
|
- info.set_payload(payload.get()); |
794 |
|
-hook(&info); |
|
790 |
+hook(&PanicInfo::new(location, payload.get(), can_unwind, force_no_backtrace)); |
795 |
791 |
} |
796 |
|
-}; |
797 |
|
-drop(hook); |
|
792 |
+} |
798 |
793 |
|
799 |
794 |
// Indicate that we have finished executing the panic hook. After this point |
800 |
795 |
// it is fine if there is a panic while executing destructors, as long as it |