File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ use crate::backtrace_rs::{self, BytesOrWideString};
92
92
use crate :: env;
93
93
use crate :: ffi:: c_void;
94
94
use crate :: fmt;
95
+ use crate :: panic:: UnwindSafe ;
95
96
use crate :: sync:: atomic:: { AtomicUsize , Ordering :: Relaxed } ;
96
97
use crate :: sync:: LazyLock ;
97
98
use crate :: sys_common:: backtrace:: { lock, output_filename} ;
@@ -427,7 +428,7 @@ impl fmt::Display for Backtrace {
427
428
}
428
429
}
429
430
430
- type LazyResolve = impl ( FnOnce ( ) -> Capture ) + Send + Sync ;
431
+ type LazyResolve = impl ( FnOnce ( ) -> Capture ) + Send + Sync + UnwindSafe ;
431
432
432
433
fn lazy_resolve ( mut capture : Capture ) -> LazyResolve {
433
434
move || {
Original file line number Diff line number Diff line change 1
1
use super :: * ;
2
+ use crate :: panic:: { RefUnwindSafe , UnwindSafe } ;
2
3
3
4
fn generate_fake_frames ( ) -> Vec < BacktraceFrame > {
4
5
vec ! [
@@ -91,3 +92,9 @@ fn test_frames() {
91
92
92
93
assert ! ( iter. all( |( f, e) | format!( "{f:#?}" ) == * e) ) ;
93
94
}
95
+
96
+ #[ test]
97
+ fn backtrace_unwind_safe ( ) {
98
+ fn assert_unwind_safe < T : UnwindSafe + RefUnwindSafe > ( ) { }
99
+ assert_unwind_safe :: < Backtrace > ( ) ;
100
+ }
You can’t perform that action at this time.
0 commit comments