File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 1515//!
1616//! This is the default unwinding API for all non-Windows platforms currently.
1717
18- use super :: super :: Bomb ;
1918use core:: ffi:: c_void;
2019use core:: ptr:: addr_of_mut;
2120
@@ -100,6 +99,18 @@ impl Clone for Frame {
10099 }
101100}
102101
102+ struct Bomb {
103+ enabled : bool ,
104+ }
105+
106+ impl Drop for Bomb {
107+ fn drop ( & mut self ) {
108+ if self . enabled {
109+ panic ! ( "cannot panic during the backtrace function" ) ;
110+ }
111+ }
112+ }
113+
103114#[ inline( always) ]
104115pub unsafe fn trace ( mut cb : & mut dyn FnMut ( & super :: Frame ) -> bool ) {
105116 uw:: _Unwind_Backtrace ( trace_fn, addr_of_mut ! ( cb) . cast ( ) ) ;
Original file line number Diff line number Diff line change @@ -138,20 +138,6 @@ cfg_if::cfg_if! {
138138 }
139139}
140140
141- #[ allow( dead_code) ]
142- struct Bomb {
143- enabled : bool ,
144- }
145-
146- #[ allow( dead_code) ]
147- impl Drop for Bomb {
148- fn drop ( & mut self ) {
149- if self . enabled {
150- panic ! ( "cannot panic during the backtrace function" ) ;
151- }
152- }
153- }
154-
155141#[ allow( dead_code) ]
156142#[ cfg( feature = "std" ) ]
157143mod lock {
You can’t perform that action at this time.
0 commit comments