-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix Vec::map_in_place
not doing what is written in the comment
#18908
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
Conversation
Can a test be added for this as well? |
@alexcrichton I'm not sure how to do this for the zero-sized types. When I add a destructor to a zero-sized it gets a drop flag and isn't zero-sized anymore. |
So basically this is dead code until we remove the drop flag? You could still add a test that should "still" work once the drop flag is gone. |
Would |
Is there a timeframe for removing drop flags? |
@alexcrichton I tried this, but my conclusion is that you can't test for it right now.
For this to work, we must have stack-based drop flags. |
cc me. |
Hm ok, looks ok to me then! |
I still think it would be reasonable to add a test that is effectively "dead code" now, but will stop being dead when the drop-flags become stack based. That is, code that makes sure destructors aren't called here on zero-sized types. This is trivially true now because such an object doesn't actually exist, but they will, and we might as well write the test now while we remember. |
@gankro How would you want to do that? If you can tell me a way, I'll implement it. |
@tbu- I imagine something like:
This should trivially be true before and after this PR, and non-trivially true when we get stack-flags |
Fix: Detect missing errors for } braces before else in let...else statements
No description provided.