Skip to content

Commit 776be7e

Browse files
committed
promot debug_assert to assert
1 parent ecb867e commit 776be7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/sys/unix/rwlock.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ impl RWLock {
4848
}
4949
panic!("rwlock read lock would result in deadlock");
5050
} else {
51-
// According to POSIX, for a properly initialized rwlock this can only
52-
// return EAGAIN or EDEADLK or 0. We rely on that.
53-
debug_assert_eq!(r, 0);
51+
// POSIX does not make guarantees about all the errors that may be returned.
52+
// See issue #94705 for more details.
53+
assert_eq!(r, 0, "unexpected error during rwlock read lock: {:?}", r);
5454
self.num_readers.fetch_add(1, Ordering::Relaxed);
5555
}
5656
}

0 commit comments

Comments
 (0)