Make backtrace optional

This commit is contained in:
Aleksey Kladov 2020-02-19 16:28:25 +01:00
parent 27587f3501
commit 2ff23c172e
2 changed files with 2 additions and 1 deletions

View file

@ -11,7 +11,7 @@ doctest = false
[dependencies]
once_cell = "1.3.1"
itertools = "0.8.2"
backtrace = "0.3.44"
backtrace = { version = "0.3.44", optional = true }
[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = { version = "0.3.2", optional = true }

View file

@ -315,6 +315,7 @@ fn idx_to_children(msgs: &[Message]) -> Vec<Vec<usize>> {
}
/// Prints backtrace to stderr, useful for debugging.
#[cfg(feature = "backtrace")]
pub fn print_backtrace() {
let bt = backtrace::Backtrace::new();
eprintln!("{:?}", bt);