Skip to content

Commit 0968bea

Browse files
committed
move Bomb into libunwind, remove dead_code
1 parent eb68d01 commit 0968bea

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/backtrace/libunwind.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//!
1616
//! This is the default unwinding API for all non-Windows platforms currently.
1717
18-
use super::super::Bomb;
1918
use core::ffi::c_void;
2019
use 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)]
104115
pub unsafe fn trace(mut cb: &mut dyn FnMut(&super::Frame) -> bool) {
105116
uw::_Unwind_Backtrace(trace_fn, addr_of_mut!(cb).cast());

src/lib.rs

-14
Original file line numberDiff line numberDiff 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")]
157143
mod lock {

0 commit comments

Comments
 (0)