Gate nightly diagnostics behind feature

This commit is contained in:
Kent Overstreet 2026-06-15 10:35:04 -05:00
commit b76ac9f405
6 changed files with 18 additions and 12 deletions

View file

@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
Self { inner: Mutex::new(value) }
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
let location = Location::caller();
let guard = self.inner.lock().await;
@ -125,7 +125,7 @@ impl<T> TrackedMutex<T> {
}
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
let location = Location::caller();
let guard = self.inner.try_lock()?;
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
Self { inner: RwLock::new(value) }
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
let location = Location::caller();
let guard = self.inner.read().await;
@ -182,7 +182,7 @@ impl<T> TrackedRwLock<T> {
}
}
#[track_caller]
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
let location = Location::caller();
let guard = self.inner.write().await;