From 2ff23c172eb7b74154851de415a01fc2e5a545de Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Feb 2020 16:28:25 +0100 Subject: Make backtrace optional --- crates/ra_prof/Cargo.toml | 2 +- crates/ra_prof/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ra_prof/Cargo.toml b/crates/ra_prof/Cargo.toml index e06a6d7d2..823745795 100644 --- a/crates/ra_prof/Cargo.toml +++ b/crates/ra_prof/Cargo.toml @@ -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 } diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 660d85b42..6853a4794 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs @@ -315,6 +315,7 @@ fn idx_to_children(msgs: &[Message]) -> Vec> { } /// Prints backtrace to stderr, useful for debugging. +#[cfg(feature = "backtrace")] pub fn print_backtrace() { let bt = backtrace::Backtrace::new(); eprintln!("{:?}", bt); -- cgit v1.2.3