Skip to content

Conversation

faern
Copy link
Contributor

@faern faern commented Dec 14, 2018

Fixes #54552.

This panic is because recv_timeout uses Instant::now() + timeout internally. This possible panic is not mentioned in the documentation for this method.

Very recently we merged (still unstable) support for checked addition (#56490) of Instant + Duration, so it's now finally possible to add these together without risking a panic.

@rust-highfive
Copy link
Contributor

r? @KodrAus

(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 Dec 14, 2018
@KodrAus
Copy link
Contributor

KodrAus commented Jan 1, 2019

Thanks @faern! The documentation updates are appreciated 👍

The assumption that the only reason this would overflow is because a massive duration has been supplied seems ok to me, but I apologize in advance to any time travelers suffering from Y300000K bugs and looking for someone to blame.

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 1, 2019

📌 Commit 496f547 has been approved by KodrAus

@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 Jan 1, 2019
@bors
Copy link
Collaborator

bors commented Jan 2, 2019

⌛ Testing commit 496f547 with merge 9653034...

bors added a commit that referenced this pull request Jan 2, 2019
Eliminate Receiver::recv_timeout panic

Fixes #54552.

This panic is because `recv_timeout` uses `Instant::now() + timeout` internally. This possible panic is not mentioned in the documentation for this method.

Very recently we merged (still unstable) support for checked addition (#56490) of `Instant + Duration`, so it's now finally possible to add these together without risking a panic.
@bors
Copy link
Collaborator

bors commented Jan 2, 2019

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

@bors bors merged commit 496f547 into rust-lang:master Jan 2, 2019
@faern faern deleted the eliminate-recv-timeout-panic branch January 31, 2019 19:51
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.

4 participants