@@ -428,37 +428,41 @@ impl fmt::Display for Backtrace {
428
428
}
429
429
}
430
430
431
- type LazyResolve = impl ( FnOnce ( ) -> Capture ) + Send + Sync + UnwindSafe ;
432
-
433
- fn lazy_resolve ( mut capture : Capture ) -> LazyResolve {
434
- move || {
435
- // Use the global backtrace lock to synchronize this as it's a
436
- // requirement of the `backtrace` crate, and then actually resolve
437
- // everything.
438
- let _lock = lock ( ) ;
439
- for frame in capture. frames . iter_mut ( ) {
440
- let symbols = & mut frame. symbols ;
441
- let frame = match & frame. frame {
442
- RawFrame :: Actual ( frame) => frame,
443
- #[ cfg( test) ]
444
- RawFrame :: Fake => unimplemented ! ( ) ,
445
- } ;
446
- unsafe {
447
- backtrace_rs:: resolve_frame_unsynchronized ( frame, |symbol| {
448
- symbols. push ( BacktraceSymbol {
449
- name : symbol. name ( ) . map ( |m| m. as_bytes ( ) . to_vec ( ) ) ,
450
- filename : symbol. filename_raw ( ) . map ( |b| match b {
451
- BytesOrWideString :: Bytes ( b) => BytesOrWide :: Bytes ( b. to_owned ( ) ) ,
452
- BytesOrWideString :: Wide ( b) => BytesOrWide :: Wide ( b. to_owned ( ) ) ,
453
- } ) ,
454
- lineno : symbol. lineno ( ) ,
455
- colno : symbol. colno ( ) ,
431
+ use define:: * ;
432
+ mod define {
433
+ use super :: * ;
434
+ pub ( super ) type LazyResolve = impl ( FnOnce ( ) -> Capture ) + Send + Sync + UnwindSafe ;
435
+
436
+ pub ( super ) fn lazy_resolve ( mut capture : Capture ) -> LazyResolve {
437
+ move || {
438
+ // Use the global backtrace lock to synchronize this as it's a
439
+ // requirement of the `backtrace` crate, and then actually resolve
440
+ // everything.
441
+ let _lock = lock ( ) ;
442
+ for frame in capture. frames . iter_mut ( ) {
443
+ let symbols = & mut frame. symbols ;
444
+ let frame = match & frame. frame {
445
+ RawFrame :: Actual ( frame) => frame,
446
+ #[ cfg( test) ]
447
+ RawFrame :: Fake => unimplemented ! ( ) ,
448
+ } ;
449
+ unsafe {
450
+ backtrace_rs:: resolve_frame_unsynchronized ( frame, |symbol| {
451
+ symbols. push ( BacktraceSymbol {
452
+ name : symbol. name ( ) . map ( |m| m. as_bytes ( ) . to_vec ( ) ) ,
453
+ filename : symbol. filename_raw ( ) . map ( |b| match b {
454
+ BytesOrWideString :: Bytes ( b) => BytesOrWide :: Bytes ( b. to_owned ( ) ) ,
455
+ BytesOrWideString :: Wide ( b) => BytesOrWide :: Wide ( b. to_owned ( ) ) ,
456
+ } ) ,
457
+ lineno : symbol. lineno ( ) ,
458
+ colno : symbol. colno ( ) ,
459
+ } ) ;
456
460
} ) ;
457
- } ) ;
461
+ }
458
462
}
459
- }
460
463
461
- capture
464
+ capture
465
+ }
462
466
}
463
467
}
464
468
0 commit comments