From 12297ab67533200748ee9f60da4bc86dee1133d9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 28 Mar 2020 13:19:05 +0100 Subject: Fix race in the tests --- crates/ra_prof/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/ra_prof/src') diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 9e167db96..00ea3a9b0 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs @@ -339,6 +339,14 @@ pub fn print_backtrace() { let bt = backtrace::Backtrace::new(); eprintln!("{:?}", bt); } +#[cfg(not(feature = "backtrace"))] +pub fn print_backtrace() { + eprintln!( + r#"enable the backtrace feature: + ra_prof = {{ path = "../ra_prof", features = [ "backtrace"] }} +"# + ); +} thread_local!(static IN_SCOPE: RefCell = RefCell::new(false)); -- cgit v1.2.3