mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Merge #10207
10207: minor: improve readability r=matklad a=matklad
It's important that module interface doesn't depend on features. Better
hide features in bodies.
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
abdb75912c
@ -19,13 +19,11 @@ pub fn timeit(label: &'static str) -> impl Drop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Prints backtrace to stderr, useful for debugging.
|
/// 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() {
|
pub fn print_backtrace() {
|
||||||
|
#[cfg(feature = "backtrace")]
|
||||||
|
eprintln!("{:?}", backtrace::Backtrace::new());
|
||||||
|
|
||||||
|
#[cfg(not(feature = "backtrace"))]
|
||||||
eprintln!(
|
eprintln!(
|
||||||
r#"Enable the backtrace feature.
|
r#"Enable the backtrace feature.
|
||||||
Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.
|
Uncomment `default = [ "backtrace" ]` in `crates/stdx/Cargo.toml`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user