Skip to content

Commit 478ba4e

Browse files
committed
Remove redundant set_panic_hook (merge issue)
1 parent 9775aae commit 478ba4e

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

mmtk/src/lib.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -131,40 +131,6 @@ extern "C" {
131131
pub static jl_true: *mut crate::julia_types::jl_value_t;
132132
}
133133

134-
pub(crate) fn set_panic_hook() {
135-
let old_hook = std::panic::take_hook();
136-
137-
std::panic::set_hook(Box::new(move |panic_info| {
138-
if crate::collection::is_gc_thread() {
139-
eprintln!("ERROR: An MMTk GC thread panicked. This is a bug.");
140-
eprintln!("{panic_info}");
141-
142-
let bt = std::backtrace::Backtrace::capture();
143-
match bt.status() {
144-
std::backtrace::BacktraceStatus::Unsupported => {
145-
eprintln!("Backtrace is unsupported.")
146-
}
147-
std::backtrace::BacktraceStatus::Disabled => {
148-
eprintln!("Backtrace is disabled.");
149-
eprintln!(
150-
"run with `RUST_BACKTRACE=1` environment variable to display a backtrace"
151-
);
152-
}
153-
std::backtrace::BacktraceStatus::Captured => {
154-
eprintln!("{bt}");
155-
}
156-
s => {
157-
eprintln!("Unknown backtrace status: {s:?}");
158-
}
159-
}
160-
161-
std::process::abort();
162-
} else {
163-
old_hook(panic_info);
164-
}
165-
}));
166-
}
167-
168134
#[macro_export]
169135
macro_rules! early_return_for_non_moving_build {
170136
($ret_val:expr) => {

0 commit comments

Comments
 (0)