File tree 2 files changed +12
-15
lines changed
2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 15
15
//!
16
16
//! This is the default unwinding API for all non-Windows platforms currently.
17
17
18
- use super :: super :: Bomb ;
19
18
use core:: ffi:: c_void;
20
19
use core:: ptr:: addr_of_mut;
21
20
@@ -100,6 +99,18 @@ impl Clone for Frame {
100
99
}
101
100
}
102
101
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
+
103
114
#[ inline( always) ]
104
115
pub unsafe fn trace ( mut cb : & mut dyn FnMut ( & super :: Frame ) -> bool ) {
105
116
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! {
138
138
}
139
139
}
140
140
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
-
155
141
#[ allow( dead_code) ]
156
142
#[ cfg( feature = "std" ) ]
157
143
mod lock {
You can’t perform that action at this time.
0 commit comments