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

Add IpAddr common methods #34694

Merged
merged 4 commits into from Jul 20, 2016

Conversation

Projects
None yet
8 participants
@mathphreak
Contributor

mathphreak commented Jul 6, 2016

Per rust-lang/rfcs#1668 (comment) no RFC is needed here.

The generated documentation for these methods is being weird. It shows a deprecation message referencing #27709 for each of them even though two of the referenced methods were stabilized as part of that issue. I don't know how best to address that.

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Jul 6, 2016

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -59,6 +59,48 @@ pub enum Ipv6MulticastScope {
Global
}

impl IpAddr {
/// Returns true for the special 'unspecified' address (0.0.0.0 in IPv4, :: in IPv6).
pub fn is_unspecified(&self) -> bool {

This comment has been minimized.

@sfackler

sfackler Jul 7, 2016

Member

These will all want to be marked unstable.

This comment has been minimized.

@mathphreak

mathphreak Jul 7, 2016

Contributor

@sfackler Should I use feature="ip" and issue="27709" or should I use a different feature or issue? (#27709 and feature="ip" are what the Ipv4/v6Addr convenience methods already use.)

This comment has been minimized.

@sfackler

sfackler Jul 7, 2016

Member

Yeah, I think reusing that issue and feature makes sense, unless @alexcrichton disagrees.

mathphreak added some commits Jul 7, 2016

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 7, 2016

Thanks @mathphreak! Perhaps the documentation could also link to the relevant methods on Ipv4Addr and Ipv6Addr as well? Other than that looks good to me, I've tagged with T-libs to ensure this comes up during triage, but I suspect we'll all be ok with it.

cc @rust-lang/libs

@brson

This comment has been minimized.

Contributor

brson commented Jul 7, 2016

lgtm

/// [IPv4]: ../../std/net/struct.Ipv4Addr.html#method.is_unspecified
/// [IPv6]: ../../std/net/struct.Ipv6Addr.html#method.is_unspecified
#[unstable(feature="ip", issue="27709",
reason="recently added and depends on unstable Ipv4Addr.is_unspecified()")]

This comment has been minimized.

@therealbstern

therealbstern Jul 9, 2016

Contributor

Per #27709 (comment), ipv4Addr.is_unspecified shouldn't be unstable (PR #34739 for stabilization).

This comment has been minimized.

@mathphreak

mathphreak Jul 9, 2016

Contributor

@therealbstern I'll keep an eye out for that PR and update this once it gets merged.

bors added a commit that referenced this pull request Jul 13, 2016

Auto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton
Mark Ipv4Addr is_unspecified as stable and provide reference.

Per [#27709 (comment)](#27709 (comment)), no RFC is needed here.

IPv4 "unspecified" has been defined in [Stevens], and has been part of the IPv4 stack for quite some time.  This property should become stable, since this use of 0.0.0.0 is not going anywhere.

[Stevens][_UNIX Network Programming Volume 1, Second Edition_.  Stevens, W. Richard.  Prentice-Hall, 1998.  p. 891]

Please let me know if I got the rustdoc wrong or something.  I tried to be as terse as possible while still conveying the appropriate information.

This also has a slight impact on PR #34694, but that one came first, so this shouldn't block it, IMO.
@aturon

This comment has been minimized.

Member

aturon commented Jul 13, 2016

I'm fine with these changes.

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 19, 2016

Discussed today during libs triage we decided to merge, thanks again for the PR @mathphreak!

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 19, 2016

@bors: r+

@bors

This comment has been minimized.

Contributor

bors commented Jul 19, 2016

📌 Commit 58da5dd has been approved by alexcrichton

@bors

This comment has been minimized.

Contributor

bors commented Jul 19, 2016

⌛️ Testing commit 58da5dd with merge e15afbc...

bors added a commit that referenced this pull request Jul 19, 2016

Auto merge of #34694 - mathphreak:master, r=alexcrichton
Add IpAddr common methods

Per rust-lang/rfcs#1668 (comment) no RFC is needed here.

The generated documentation for these methods is being weird. It shows a deprecation message referencing #27709 for each of them even though two of the referenced methods were stabilized as part of that issue. I don't know how best to address that.
@therealbstern

This comment has been minimized.

Contributor

therealbstern commented on src/libstd/net/ip.rs in 58da5dd Jul 19, 2016

Can we remove these unstable marks? I believe is_unspecified is now accepted as stable for both address families.

This comment has been minimized.

Member

alexcrichton replied Jul 19, 2016

Soon! These APIs were just added and the libs team goes through a "final comment period" for stabilizing APIs. These APIs are slated to become stable in 1.12, though, tracked at #27709

@bors

This comment has been minimized.

Contributor

bors commented Jul 19, 2016

💔 Test failed - auto-win-msvc-32-opt

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 19, 2016

@bors: retry

On Tue, Jul 19, 2016 at 12:08 PM, bors notifications@github.com wrote:

💔 Test failed - auto-win-msvc-32-opt
https://buildbot.rust-lang.org/builders/auto-win-msvc-32-opt/builds/4123


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34694 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95KxdeUJkoNVpmf13MMooNzKAQFw8ks5qXSDAgaJpZM4JGlo0
.

@bors

This comment has been minimized.

Contributor

bors commented Jul 20, 2016

⌛️ Testing commit 58da5dd with merge d82b3cc...

bors added a commit that referenced this pull request Jul 20, 2016

Auto merge of #34694 - mathphreak:master, r=alexcrichton
Add IpAddr common methods

Per rust-lang/rfcs#1668 (comment) no RFC is needed here.

The generated documentation for these methods is being weird. It shows a deprecation message referencing #27709 for each of them even though two of the referenced methods were stabilized as part of that issue. I don't know how best to address that.
@bors

This comment has been minimized.

Contributor

bors commented Jul 20, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 20, 2016

@bors: retry

On Tue, Jul 19, 2016 at 9:15 PM, bors notifications@github.com wrote:

💔 Test failed - auto-win-msvc-64-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt-rustbuild/builds/1821


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34694 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95G7Llj4WYWx87RUNYMgF-lZwfkzKks5qXaDPgaJpZM4JGlo0
.

@bors

This comment has been minimized.

Contributor

bors commented Jul 20, 2016

⌛️ Testing commit 58da5dd with merge 9d5965a...

bors added a commit that referenced this pull request Jul 20, 2016

Auto merge of #34694 - mathphreak:master, r=alexcrichton
Add IpAddr common methods

Per rust-lang/rfcs#1668 (comment) no RFC is needed here.

The generated documentation for these methods is being weird. It shows a deprecation message referencing #27709 for each of them even though two of the referenced methods were stabilized as part of that issue. I don't know how best to address that.

@bors bors merged commit 58da5dd into rust-lang:master Jul 20, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment