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

std: Add net::IpAddr, destabilize lookup_host #23711

Merged
merged 1 commit into from
Mar 26, 2015

Conversation

alexcrichton
Copy link
Member

This commits adds back an IpAddr enum matching the SocketAddr enum, but
without a port. The enumeration is #[unstable]. The lookup_host function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning SocketAddr values.

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned huonw Mar 25, 2015
@rust-highfive
Copy link
Collaborator

r? @huonw

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

@alexcrichton
Copy link
Member Author

@murarth
Copy link
Contributor

murarth commented Mar 25, 2015

This is great!
One question: Should SocketAddr have a shortcut constructor; e.g. fn new(ip: &IpAddr, port: u16) -> SocketAddr {...}?

@alexcrichton
Copy link
Member Author

Hm perhaps! I'm not 100% sure about it as it would silently be passing 0 for flowinfo and scope_id for IPv6 addresses. That being said we already do that elsewhere, so it's not necessarily the end of the world.

This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
@aturon
Copy link
Member

aturon commented Mar 25, 2015

LGTM! I do think we will want some additional constructors for SocketAddr, but this can be added later on. For now, we should go ahead and make the breaking changes that need to be made.

@bors: r+ 8165bc1

@bors
Copy link
Contributor

bors commented Mar 26, 2015

⌛ Testing commit 8165bc1 with merge 2157454...

@bors
Copy link
Contributor

bors commented Mar 26, 2015

💔 Test failed - auto-win-32-nopt-t

@alexcrichton
Copy link
Member Author

@bors: retry

On Wed, Mar 25, 2015 at 7:33 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-32-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/3903


Reply to this email directly or view it on GitHub
#23711 (comment).

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 26, 2015
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
erickt added a commit to erickt/rust that referenced this pull request Mar 26, 2015
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
erickt added a commit to erickt/rust that referenced this pull request Mar 26, 2015
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
@bors
Copy link
Contributor

bors commented Mar 26, 2015

⌛ Testing commit 8165bc1 with merge 1501f33...

bors added a commit that referenced this pull request Mar 26, 2015
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
@bors bors merged commit 8165bc1 into rust-lang:master Mar 26, 2015
@alexcrichton alexcrichton deleted the ip-addr branch March 27, 2015 20:37
bors bot added a commit to nix-rust/nix that referenced this pull request Apr 11, 2019
1043: Uncomment to_std and from_std methods for IpAddr r=asomers a=rabbott99

These were commented out in 2b60633, apparently because `std::net::IpAddr` had been removed from the standard library. However, `IpAddr` has since been re-added to the standard library (rust-lang/rust#23711) and stabilized (rust-lang/rust#31438), so it seems there is no reason to keep them commented out.

Co-authored-by: rabbott99 <rabbott4927@gmail.com>
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.

6 participants