|
28 | 28 | //! |
29 | 29 | //! [`lock/rank.rs`]: ../../../src/wgpu_core/lock/rank.rs.html |
30 | 30 |
|
31 | | -#![allow(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] |
32 | | - |
| 31 | +use alloc::{format, string::String}; |
| 32 | +use core::{cell::RefCell, panic::Location}; |
33 | 33 | use std::{ |
34 | | - cell::RefCell, |
35 | | - format, |
36 | 34 | fs::File, |
37 | | - panic::Location, |
38 | 35 | path::{Path, PathBuf}, |
39 | | - string::String, |
40 | 36 | }; |
41 | 37 |
|
42 | 38 | use super::rank::{LockRank, LockRankSet}; |
@@ -86,22 +82,22 @@ impl<T> Mutex<T> { |
86 | 82 | } |
87 | 83 | } |
88 | 84 |
|
89 | | -impl<'a, T> std::ops::Deref for MutexGuard<'a, T> { |
| 85 | +impl<'a, T> core::ops::Deref for MutexGuard<'a, T> { |
90 | 86 | type Target = T; |
91 | 87 |
|
92 | 88 | fn deref(&self) -> &Self::Target { |
93 | 89 | self.inner.deref() |
94 | 90 | } |
95 | 91 | } |
96 | 92 |
|
97 | | -impl<'a, T> std::ops::DerefMut for MutexGuard<'a, T> { |
| 93 | +impl<'a, T> core::ops::DerefMut for MutexGuard<'a, T> { |
98 | 94 | fn deref_mut(&mut self) -> &mut Self::Target { |
99 | 95 | self.inner.deref_mut() |
100 | 96 | } |
101 | 97 | } |
102 | 98 |
|
103 | | -impl<T: std::fmt::Debug> std::fmt::Debug for Mutex<T> { |
104 | | - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 99 | +impl<T: core::fmt::Debug> core::fmt::Debug for Mutex<T> { |
| 100 | + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
105 | 101 | self.inner.fmt(f) |
106 | 102 | } |
107 | 103 | } |
@@ -175,29 +171,29 @@ impl<'a, T> RwLockWriteGuard<'a, T> { |
175 | 171 | } |
176 | 172 | } |
177 | 173 |
|
178 | | -impl<T: std::fmt::Debug> std::fmt::Debug for RwLock<T> { |
179 | | - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 174 | +impl<T: core::fmt::Debug> core::fmt::Debug for RwLock<T> { |
| 175 | + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
180 | 176 | self.inner.fmt(f) |
181 | 177 | } |
182 | 178 | } |
183 | 179 |
|
184 | | -impl<'a, T> std::ops::Deref for RwLockReadGuard<'a, T> { |
| 180 | +impl<'a, T> core::ops::Deref for RwLockReadGuard<'a, T> { |
185 | 181 | type Target = T; |
186 | 182 |
|
187 | 183 | fn deref(&self) -> &Self::Target { |
188 | 184 | self.inner.deref() |
189 | 185 | } |
190 | 186 | } |
191 | 187 |
|
192 | | -impl<'a, T> std::ops::Deref for RwLockWriteGuard<'a, T> { |
| 188 | +impl<'a, T> core::ops::Deref for RwLockWriteGuard<'a, T> { |
193 | 189 | type Target = T; |
194 | 190 |
|
195 | 191 | fn deref(&self) -> &Self::Target { |
196 | 192 | self.inner.deref() |
197 | 193 | } |
198 | 194 | } |
199 | 195 |
|
200 | | -impl<'a, T> std::ops::DerefMut for RwLockWriteGuard<'a, T> { |
| 196 | +impl<'a, T> core::ops::DerefMut for RwLockWriteGuard<'a, T> { |
201 | 197 | fn deref_mut(&mut self) -> &mut Self::Target { |
202 | 198 | self.inner.deref_mut() |
203 | 199 | } |
@@ -275,7 +271,7 @@ fn acquire(new_rank: LockRank, location: &'static Location<'static>) -> Option<H |
275 | 271 | log.write_acquisition(held_lock, new_rank, location); |
276 | 272 | } |
277 | 273 |
|
278 | | - std::mem::replace( |
| 274 | + core::mem::replace( |
279 | 275 | held_lock, |
280 | 276 | Some(HeldLock { |
281 | 277 | rank: new_rank, |
@@ -482,7 +478,7 @@ impl LockRankSet { |
482 | 478 | } |
483 | 479 | } |
484 | 480 |
|
485 | | -/// Convenience for `std::ptr::from_ref(t) as usize`. |
| 481 | +/// Convenience for `core::ptr::from_ref(t) as usize`. |
486 | 482 | fn addr<T>(t: &T) -> usize { |
487 | | - std::ptr::from_ref(t) as usize |
| 483 | + core::ptr::from_ref(t) as usize |
488 | 484 | } |
0 commit comments