mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Profiling tweaks
This commit is contained in:
parent
539659cde3
commit
e7ba7f47a7
3 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,7 @@ pub struct Scope {
|
|||
}
|
||||
|
||||
impl Scope {
|
||||
#[must_use]
|
||||
pub fn enter() -> Scope {
|
||||
let prev = IN_SCOPE.with(|slot| std::mem::replace(&mut *slot.borrow_mut(), true));
|
||||
Scope { prev }
|
||||
|
@ -78,6 +79,7 @@ pub struct CpuProfiler {
|
|||
_private: (),
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn cpu_profiler() -> CpuProfiler {
|
||||
#[cfg(feature = "cpu_profiler")]
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue