Skip to content

Commit a077e44

Browse files
authored
Rollup merge of #94712 - kckeiks:remove-rwlock-read-error-assumption, r=Mark-Simulacrum
promot debug_assert to assert Fixes #94705
2 parents 98d027c + 776be7e commit a077e44

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)