Skip to content

Commit 406fd3a

Browse files
committed
silence dead code warnings on windows
1 parent 55ca27f commit 406fd3a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/std/src/sys_common/rwlock.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
use crate::sys::rwlock as imp;
22

3+
#[cfg(unix)]
34
enum GuardType {
45
Read,
56
Write,
67
}
78

9+
#[cfg(unix)]
810
pub struct RWLockGuard(&'static RWLock, GuardType);
911

12+
#[cfg(unix)]
1013
impl Drop for RWLockGuard {
1114
fn drop(&mut self) {
1215
unsafe {
@@ -52,6 +55,7 @@ impl RWLock {
5255
/// Behavior is undefined if the rwlock has been moved between this and any
5356
/// previous method call.
5457
#[inline]
58+
#[cfg(unix)]
5559
pub unsafe fn read_with_guard(&'static self) -> RWLockGuard {
5660
self.read();
5761
RWLockGuard(&self, GuardType::Read)
@@ -87,6 +91,7 @@ impl RWLock {
8791
/// Behavior is undefined if the rwlock has been moved between this and any
8892
/// previous method call.
8993
#[inline]
94+
#[cfg(unix)]
9095
pub unsafe fn write_with_guard(&'static self) -> RWLockGuard {
9196
self.write();
9297
RWLockGuard(&self, GuardType::Write)

0 commit comments

Comments
 (0)