Don't panic while already panicking in BoxSlot::drop

This commit is contained in:
Anthony Ramine 2020-05-15 12:12:37 +02:00
parent 50bd5c3e0f
commit f4c4af2bd4

View file

@ -346,8 +346,10 @@ impl BoxSlot<'_> {
impl Drop for BoxSlot<'_> {
fn drop(&mut self) {
if let Some(slot) = &mut self.slot {
assert!(slot.borrow().is_some(), "failed to set a layout box");
if !std::thread::panicking() {
if let Some(slot) = &mut self.slot {
assert!(slot.borrow().is_some(), "failed to set a layout box");
}
}
}
}