-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop skipped on panic #27906
Comments
cc @pnkfelix since it's drop related |
I believe this is a dupe of #14875, so closing in favor of that |
@alexcrichton Looks like it. Thanks. |
@Stebalien did you find a bug in arrayvec? |
FWIW, that feels like a panic safety bug in arrayvec, not really a bug in rust? |
The bug in rust is that my PR doesn't work unless the item is dropped explicitly by calling drop on it.Steven Allen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was working on a patch for @bluss's arrayvec and ran into the following issue. In the code below, I'm trying to keep the
Test
struct from dropping twice even if it panics on drop. If I explicitly drop theTest
when reading it out of the array (usingptr::read
), everything works. However, if I don't explicitly drop it (see XXX), it drops (good), panics (good), but thenguard
isn't dropped (bad) so theTest
is dropped a second time (bad).Sorry for the generic title.
The text was updated successfully, but these errors were encountered: