@@ -344,7 +344,7 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments,
344
344
345
345
let mut s = String :: new ( ) ;
346
346
let _ = s. write_fmt ( * msg) ;
347
- begin_panic ( s , file_line_col)
347
+ rust_panic_with_hook ( Box :: new ( s ) , Some ( msg ) , file_line_col)
348
348
}
349
349
350
350
/// This is the entry point of panicking for panic!() and assert!().
@@ -360,7 +360,7 @@ pub fn begin_panic<M: Any + Send>(msg: M, file_line_col: &(&'static str, u32, u3
360
360
// be performed in the parent of this thread instead of the thread that's
361
361
// panicking.
362
362
363
- rust_panic_with_hook ( Box :: new ( msg) , file_line_col)
363
+ rust_panic_with_hook ( Box :: new ( msg) , None , file_line_col)
364
364
}
365
365
366
366
/// Executes the primary logic for a panic, including checking for recursive
@@ -371,7 +371,8 @@ pub fn begin_panic<M: Any + Send>(msg: M, file_line_col: &(&'static str, u32, u3
371
371
/// run panic hooks, and then delegate to the actual implementation of panics.
372
372
#[ inline( never) ]
373
373
#[ cold]
374
- fn rust_panic_with_hook ( msg : Box < Any + Send > ,
374
+ fn rust_panic_with_hook ( payload : Box < Any + Send > ,
375
+ message : Option < & fmt:: Arguments > ,
375
376
file_line_col : & ( & ' static str , u32 , u32 ) ) -> ! {
376
377
let ( file, line, col) = * file_line_col;
377
378
@@ -390,8 +391,8 @@ fn rust_panic_with_hook(msg: Box<Any + Send>,
390
391
391
392
unsafe {
392
393
let info = PanicInfo :: internal_constructor (
393
- & * msg ,
394
- None ,
394
+ & * payload ,
395
+ message ,
395
396
Location :: internal_constructor ( file, line, col) ,
396
397
) ;
397
398
HOOK_LOCK . read ( ) ;
@@ -412,7 +413,7 @@ fn rust_panic_with_hook(msg: Box<Any + Send>,
412
413
unsafe { intrinsics:: abort ( ) }
413
414
}
414
415
415
- rust_panic ( msg )
416
+ rust_panic ( payload )
416
417
}
417
418
418
419
/// Shim around rust_panic. Called by resume_unwind.
0 commit comments