It's annoying to see a panic inside a panic if we are seeing drop() failing because we are in process of stack unwinding. We should check for this in drop() implementations and avoid doing anything that can fail.
I'd like to take this. Will post progress reports and eventual questions in this thread.
So browsing through the Drop impls, 3 seem they could use this:
impl<'a> Drop for SwapChainOutput<'a>impl<'a> Drop for ComputePass<'a>impl<'a> Drop for RenderPass<'a>They have in common that they act more like RAII guards with more logic than just destructors happening on drop. I personally only ever encountered the SwapChainOutput double panic in the wild.
@kvark do you think we should be preventing the drop logic for all three, or just SwapChainOutput? I also might have missed a place where this would be useful...
EDIT: Just tried inserting a couple a panic!() calls and it seems that preventing the drop logic in SwapChainOutput is enough to prevent the abort.
In all three, if the drop is happening inside a panic, just don't do anything.