diff options
| author | The8472 <git@infinite-source.de> | 2021-02-07 09:45:49 +0100 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2021-02-07 09:45:49 +0100 |
| commit | 406fd3a2772e62ff1b466e59de45d5caa4cfd975 (patch) | |
| tree | 53454dd395e00d183746d01ce2c9bbcb9a2a1a83 | |
| parent | 55ca27faa78434d81d3f59535c96bbb2a08f0d5c (diff) | |
| download | rust-406fd3a2772e62ff1b466e59de45d5caa4cfd975.tar.gz rust-406fd3a2772e62ff1b466e59de45d5caa4cfd975.zip | |
silence dead code warnings on windows
| -rw-r--r-- | library/std/src/sys_common/rwlock.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys_common/rwlock.rs b/library/std/src/sys_common/rwlock.rs index 1f2765ffbcc..7fd902ee0fe 100644 --- a/library/std/src/sys_common/rwlock.rs +++ b/library/std/src/sys_common/rwlock.rs @@ -1,12 +1,15 @@ use crate::sys::rwlock as imp; +#[cfg(unix)] enum GuardType { Read, Write, } +#[cfg(unix)] pub struct RWLockGuard(&'static RWLock, GuardType); +#[cfg(unix)] impl Drop for RWLockGuard { fn drop(&mut self) { unsafe { @@ -52,6 +55,7 @@ impl RWLock { /// Behavior is undefined if the rwlock has been moved between this and any /// previous method call. #[inline] + #[cfg(unix)] pub unsafe fn read_with_guard(&'static self) -> RWLockGuard { self.read(); RWLockGuard(&self, GuardType::Read) @@ -87,6 +91,7 @@ impl RWLock { /// Behavior is undefined if the rwlock has been moved between this and any /// previous method call. #[inline] + #[cfg(unix)] pub unsafe fn write_with_guard(&'static self) -> RWLockGuard { self.write(); RWLockGuard(&self, GuardType::Write) |
