diff --git a/wgpu-core/src/lock/observing.rs b/wgpu-core/src/lock/observing.rs index b50477dab53..108bdbb69e3 100644 --- a/wgpu-core/src/lock/observing.rs +++ b/wgpu-core/src/lock/observing.rs @@ -28,15 +28,11 @@ //! //! [`lock/rank.rs`]: ../../../src/wgpu_core/lock/rank.rs.html -#![allow(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] - +use alloc::{format, string::String}; +use core::{cell::RefCell, panic::Location}; use std::{ - cell::RefCell, - format, fs::File, - panic::Location, path::{Path, PathBuf}, - string::String, }; use super::rank::{LockRank, LockRankSet}; @@ -86,7 +82,7 @@ impl Mutex { } } -impl<'a, T> std::ops::Deref for MutexGuard<'a, T> { +impl<'a, T> core::ops::Deref for MutexGuard<'a, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -94,14 +90,14 @@ impl<'a, T> std::ops::Deref for MutexGuard<'a, T> { } } -impl<'a, T> std::ops::DerefMut for MutexGuard<'a, T> { +impl<'a, T> core::ops::DerefMut for MutexGuard<'a, T> { fn deref_mut(&mut self) -> &mut Self::Target { self.inner.deref_mut() } } -impl std::fmt::Debug for Mutex { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Debug for Mutex { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.inner.fmt(f) } } @@ -175,13 +171,13 @@ impl<'a, T> RwLockWriteGuard<'a, T> { } } -impl std::fmt::Debug for RwLock { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Debug for RwLock { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.inner.fmt(f) } } -impl<'a, T> std::ops::Deref for RwLockReadGuard<'a, T> { +impl<'a, T> core::ops::Deref for RwLockReadGuard<'a, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -189,7 +185,7 @@ impl<'a, T> std::ops::Deref for RwLockReadGuard<'a, T> { } } -impl<'a, T> std::ops::Deref for RwLockWriteGuard<'a, T> { +impl<'a, T> core::ops::Deref for RwLockWriteGuard<'a, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -197,7 +193,7 @@ impl<'a, T> std::ops::Deref for RwLockWriteGuard<'a, T> { } } -impl<'a, T> std::ops::DerefMut for RwLockWriteGuard<'a, T> { +impl<'a, T> core::ops::DerefMut for RwLockWriteGuard<'a, T> { fn deref_mut(&mut self) -> &mut Self::Target { self.inner.deref_mut() } @@ -275,7 +271,7 @@ fn acquire(new_rank: LockRank, location: &'static Location<'static>) -> Option(t: &T) -> usize { - std::ptr::from_ref(t) as usize + core::ptr::from_ref(t) as usize }