Deque::clear, HistoryBuf::clear, and IndexMap::clear will each invalidate the invariants of those types if an item's drop impl panics. This can lead to use-after-drop in safe code using catch_unwind. These methods should reset the relevant fields before dropping the items.