-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Use ManuallyDrop instead of Option in BinaryHeap Hole implementation #50487
Conversation
The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop. This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code.
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
@bors-servo r+ let's find out if i have perms still |
@gankro: 🔑 Insufficient privileges: Not in reviewers |
@bors r=Gankro |
📌 Commit 9f8f366 has been approved by |
Use ManuallyDrop instead of Option in BinaryHeap Hole implementation The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop. This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code. However I've seen this pattern copied from here to other crates where it is not optimized away, so I think it would be good to change it.
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks like the build failed due to some kind of infrastructure issue? |
@bors retry Failed to deploy. |
Use ManuallyDrop instead of Option in BinaryHeap Hole implementation The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop. This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code. However I've seen this pattern copied from here to other crates where it is not optimized away, so I think it would be good to change it.
☀️ Test successful - status-appveyor, status-travis |
The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop.
This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code. However I've seen this pattern copied from here to other crates where it is not optimized away, so I think it would be good to change it.