mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Make printin the backtrace more convenient
This commit is contained in:
parent
dd5b3cd6f0
commit
865e05b5b4
5 changed files with 29 additions and 26 deletions
|
@ -15,21 +15,6 @@ pub use crate::{
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue