drop: downgrade two assertions to error messages

These assertions were there to catch bugs, but when the bugs happen,
the assertions can obsure the underlying error (as @tp-woven found out
on #258). Let's just print errors instead.
This commit is contained in:
Martin von Zweigbergk 2022-05-23 15:11:30 -07:00 committed by Martin von Zweigbergk
parent ca5a2391ab
commit 45c9d297c2
2 changed files with 4 additions and 10 deletions

View file

@ -175,11 +175,8 @@ impl UnpublishedOperation {
impl Drop for UnpublishedOperation {
fn drop(&mut self) {
if !std::thread::panicking() {
assert!(
self.closed,
"UnpublishedOperation was dropped without being closed."
);
if !self.closed && !std::thread::panicking() {
eprintln!("BUG: UnpublishedOperation was dropped without being closed.");
}
}
}

View file

@ -1063,11 +1063,8 @@ impl LockedWorkingCopy<'_> {
impl Drop for LockedWorkingCopy<'_> {
fn drop(&mut self) {
if !std::thread::panicking() {
assert!(
self.closed,
"Working copy lock was dropped without being closed."
);
if !self.closed && !std::thread::panicking() {
eprintln!("BUG: Working copy lock was dropped without being closed.");
}
}
}