@@ -314,19 +314,6 @@ fn default_hook(info: &PanicInfo) {
314
314
#[ cfg( feature = "backtrace" ) ]
315
315
use sys_common:: backtrace;
316
316
317
- // If this is a double panic, make sure that we print a backtrace
318
- // for this panic. Otherwise only print it if logging is enabled.
319
- #[ cfg( feature = "backtrace" ) ]
320
- let log_backtrace = {
321
- let panics = update_panic_count ( 0 ) ;
322
-
323
- if panics >= 2 {
324
- Some ( backtrace:: PrintFormat :: Full )
325
- } else {
326
- backtrace:: log_enabled ( )
327
- }
328
- } ;
329
-
330
317
let file = info. location . file ;
331
318
let line = info. location . line ;
332
319
@@ -346,17 +333,7 @@ fn default_hook(info: &PanicInfo) {
346
333
name, msg, file, line) ;
347
334
348
335
#[ cfg( feature = "backtrace" ) ]
349
- {
350
- use sync:: atomic:: { AtomicBool , Ordering } ;
351
-
352
- static FIRST_PANIC : AtomicBool = AtomicBool :: new ( true ) ;
353
-
354
- if let Some ( format) = log_backtrace {
355
- let _ = backtrace:: print ( err, format) ;
356
- } else if FIRST_PANIC . compare_and_swap ( true , false , Ordering :: SeqCst ) {
357
- let _ = writeln ! ( err, "note: Run with `RUST_BACKTRACE=1` for a backtrace." ) ;
358
- }
359
- }
336
+ let _ = backtrace:: print ( err, backtrace:: PrintFormat :: Full ) ;
360
337
} ;
361
338
362
339
let prev = LOCAL_STDERR . with ( |s| s. borrow_mut ( ) . take ( ) ) ;
0 commit comments