mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +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
|
|
@ -21,7 +21,7 @@ pub use countme;
|
|||
/// almost zero.
|
||||
pub use countme::Count;
|
||||
|
||||
thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false));
|
||||
thread_local!(static IN_SCOPE: RefCell<bool> = const { RefCell::new(false) });
|
||||
|
||||
/// Allows to check if the current code is within some dynamic scope, can be
|
||||
/// useful during debugging to figure out why a function is called.
|
||||
|
|
@ -88,6 +88,7 @@ pub fn cpu_span() -> CpuSpan {
|
|||
}
|
||||
|
||||
#[cfg(not(feature = "cpu_profiler"))]
|
||||
#[allow(clippy::print_stderr)]
|
||||
{
|
||||
eprintln!(
|
||||
r#"cpu profiling is disabled, uncomment `default = [ "cpu_profiler" ]` in Cargo.toml to enable."#
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
//! Like `std::time::Instant`, but also measures memory & CPU cycles.
|
||||
|
||||
#![allow(clippy::print_stderr)]
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
time::{Duration, Instant},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue