From 0d84408f2e0ea00c224fe4bafbfff164d878feaa Mon Sep 17 00:00:00 2001 From: Ferdia McKeogh Date: Sat, 15 Oct 2022 10:17:25 +0100 Subject: [PATCH] Feature gate panic hook --- Cargo.toml | 3 ++- src/macros.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1d97684..75adae9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,9 +31,10 @@ without-ocamlopt = [ "ocaml-boxroot-sys/without-ocamlopt" ] caml-state = ["ocaml-sys/caml-state"] -no-std = ["cstr_core/alloc"] +no-std = ["cstr_core/alloc", "no-panic-hook"] bigarray-ext = ["ndarray"] no-caml-startup = ["ocaml-interop/no-caml-startup"] +no-panic-hook = [] [workspace] members = [ diff --git a/src/macros.rs b/src/macros.rs index 941379e..f630610 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -19,7 +19,7 @@ pub fn initial_setup() { ocaml_boxroot_sys::boxroot_setup(); } - #[cfg(not(feature = "no-std"))] + #[cfg(not(feature = "no-panic-hook"))] { ::std::panic::set_hook(Box::new(|info| unsafe { let err = info.payload();