]> git.lizzy.rs Git - rust.git/blobdiff - crates/profile/src/lib.rs
Make printin the backtrace more convenient
[rust.git] / crates / profile / src / lib.rs
index ab19271c70cf6aaaa09e62a350c1f4c392c68336..aa6ccc36c3f3a31305f3710c2c5be11ddd45ff62 100644 (file)
     stop_watch::{StopWatch, StopWatchSpan},
 };
 
-/// Prints backtrace to stderr, useful for debugging.
-#[cfg(feature = "backtrace")]
-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:
-    profile = {{ path = "../profile", features = [ "backtrace"] }}
-"#
-    );
-}
-
 thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false));
 
 /// Allows to check if the current code is withing some dynamic scope, can be