mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Lint debug prints and disallowed types with clippy
This commit is contained in:
parent
850ba2fb63
commit
9e8a0fae0c
64 changed files with 170 additions and 229 deletions
|
@ -23,12 +23,14 @@ pub fn is_ci() -> bool {
|
|||
}
|
||||
|
||||
#[must_use]
|
||||
#[allow(clippy::print_stderr)]
|
||||
pub fn timeit(label: &'static str) -> impl Drop {
|
||||
let start = Instant::now();
|
||||
defer(move || eprintln!("{}: {:.2?}", label, start.elapsed()))
|
||||
}
|
||||
|
||||
/// Prints backtrace to stderr, useful for debugging.
|
||||
#[allow(clippy::print_stderr)]
|
||||
pub fn print_backtrace() {
|
||||
#[cfg(feature = "backtrace")]
|
||||
eprintln!("{:?}", backtrace::Backtrace::new());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue