Skip to content
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

Merged
merged 1 commit into from
May 7, 2018

Conversation

nikic
Copy link
Contributor

@nikic nikic commented May 6, 2018

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.

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.
@rust-highfive
Copy link
Contributor

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2018
@Mark-Simulacrum
Copy link
Member

r? @sfackler or @gankro

@rust-highfive rust-highfive assigned sfackler and unassigned cramertj May 6, 2018
@Gankra
Copy link
Contributor

Gankra commented May 6, 2018

@bors-servo r+

let's find out if i have perms still

@bors
Copy link
Collaborator

bors commented May 6, 2018

@gankro: 🔑 Insufficient privileges: Not in reviewers

@Mark-Simulacrum
Copy link
Member

@bors r=Gankro

@bors
Copy link
Collaborator

bors commented May 6, 2018

📌 Commit 9f8f366 has been approved by Gankro

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2018
@bors
Copy link
Collaborator

bors commented May 7, 2018

⌛ Testing commit 9f8f366 with merge 3b225bb...

bors added a commit that referenced this pull request May 7, 2018
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.
@bors
Copy link
Collaborator

bors commented May 7, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 7, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@nikic
Copy link
Contributor Author

nikic commented May 7, 2018

Looks like the build failed due to some kind of infrastructure issue?

@kennytm
Copy link
Member

kennytm commented May 7, 2018

@bors retry

Failed to deploy.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 7, 2018
@bors
Copy link
Collaborator

bors commented May 7, 2018

⌛ Testing commit 9f8f366 with merge 6288970...

bors added a commit that referenced this pull request May 7, 2018
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.
@bors
Copy link
Collaborator

bors commented May 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Gankro
Pushing 6288970 to master...

@bors bors merged commit 9f8f366 into rust-lang:master May 7, 2018
clint-white added a commit to clint-white/binary-heap-plus-rs that referenced this pull request Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants