Skip to content

Commit

Permalink
Rollup merge of rust-lang#94712 - kckeiks:remove-rwlock-read-error-as…
Browse files Browse the repository at this point in the history
…sumption, r=Mark-Simulacrum

promot debug_assert to assert

Fixes rust-lang#94705
  • Loading branch information
Dylan-DPC authored Mar 8, 2022
2 parents ccce014 + 776be7e commit cfed5de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/std/src/sys/unix/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ impl RWLock {
}
panic!("rwlock read lock would result in deadlock");
} else {
// According to POSIX, for a properly initialized rwlock this can only
// return EAGAIN or EDEADLK or 0. We rely on that.
debug_assert_eq!(r, 0);
// POSIX does not make guarantees about all the errors that may be returned.
// See issue #94705 for more details.
assert_eq!(r, 0, "unexpected error during rwlock read lock: {:?}", r);
self.num_readers.fetch_add(1, Ordering::Relaxed);
}
}
Expand Down

0 comments on commit cfed5de

Please sign in to comment.