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

Clarify that send_to might fail in certain cases #37432

Merged
merged 1 commit into from
Nov 9, 2016

Conversation

achanda
Copy link
Contributor

@achanda achanda commented Oct 27, 2016

Closes #34202

r? @alexcrichton

@alexcrichton
Copy link
Member

Hm this doesn't panic, right? It'd return an error?

@CensoredUsername
Copy link
Contributor

This doesn't panic, it returns an error. In the linked issue unwrap() is just called on the error so it panics.

@achanda
Copy link
Contributor Author

achanda commented Oct 28, 2016

My bad, updated now.

@@ -67,6 +67,9 @@ impl UdpSocket {
///
/// Address type can be any implementor of `ToSocketAddrs` trait. See its
/// documentation for concrete examples.
/// This might return an error when using local addresses using the string
/// "localhost". See https://github.com/rust-lang/rust/issues/34202 for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we may want to generalize this error to more than just this issue. It may be worth just mentioning that the returned addresses from ToSocketAddrs must match the IPv4 or IPv6-ness of the address the UDP socket is bound to. This problem isn't only related to localhost I believe.

@brson
Copy link
Contributor

brson commented Nov 9, 2016

Waiting for updates to @alexcrichton's feedback.

@achanda
Copy link
Contributor Author

achanda commented Nov 9, 2016

Sorry, this fell off my radar. Updated now.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 9, 2016

📌 Commit 50bfc23 has been approved by alexcrichton

@sfackler sfackler changed the title Clarify that send_to might panic in certain cases Clarify that send_to might fail in certain cases Nov 9, 2016
eddyb added a commit to eddyb/rust that referenced this pull request Nov 9, 2016
Clarify that send_to might panic in certain cases

Closes rust-lang#34202

r? @alexcrichton
bors added a commit that referenced this pull request Nov 9, 2016
Rollup of 15 pull requests

- Successful merges: #36868, #37134, #37229, #37250, #37370, #37428, #37432, #37472, #37524, #37614, #37622, #37627, #37636, #37644, #37654
- Failed merges: #37463, #37542, #37645
@bors bors merged commit 50bfc23 into rust-lang:master Nov 9, 2016
@achanda achanda deleted the send_to branch November 10, 2016 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants