-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Un-deprecate IpAddr #1451
Comments
"too small to pull it's weight" looks like it means "not enough functionality to deserve a place in std" |
This little feature saves a lot of typing. I'm just having to repeat myself every time I need this little feature. |
Just being the |
|
We want to move DNS lookup out of tree and deprecate the in-tree functionality so the API can be improved: rust-lang/rust#27705. |
+1 this is a very useful type to have a common definition of, and fits in with the rest of std's net types. The ip crate works but really shouldn't be necessary, even if the type isn't used much as an input by |
+1 It certainly makes no sense to have |
+1 for IpAddr being returned. The workarounds are possible with ip crate or own copy etc. but ends up with very messy files and code that is more confusing than it needs to be. This seems to be well used by many projects and seems everyone is working around something in almost the same way. So makes sense to have this in std, esp if socketaddr is, which is really helpful. |
@sfackler “DNS lookup” includes the de-facto-stable implementations of @alexcrichton I remember discussing with you criteria for what should be in +1 |
+1 |
@SimonSapin Those trait implementations can't move, so no, they're staying where they are. |
+1 |
I had an issue report the other day pointing out another reason that the Not the worst thing in the world, for sure, but for whatever it is worth this speaks in favour of reinstating |
Haven't we already gone through this dance? #988 It's a tiny unifying enum for a bog-standard use case that multiple people on multiple occasions have said they use and will need to reimplement if it disappears. Please just keep it. |
The libs team discussed this at triage today, and the conclusion was that given how much support there is for this type that we can likely just change the deprecated tags to stable. The type has already gone through an FCP and is a pretty minor surface area, so there's not necessarily any need for another FCP. |
Yep, it was clearly the wrong decision to deprecate -- there's a clear community consensus to ship this, and the rationale for deprecation essentially boiled down to a concern about minimalism in In any case, I've opened a PR to revert, which actually stabilizes the enum as of 1.7 (currently in beta). That will require a backport. |
After [considerable pushback](rust-lang/rfcs#1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it. This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport).
After [considerable pushback](rust-lang/rfcs#1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it. This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport). r? @alexcrichton
After [considerable pushback](rust-lang/rfcs#1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it. This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport).
The
IpAddr
type recently got deprecated from the standard library.This means libstd now has:
SocketAddrV4
SocketAddrV6
SocketAddr
Ipv4Addr
Ipv6Addr
IpAddr
This is silly.
IpAddr
fits in perfectly with the other types here. It's useful to be able to decompose aSocketAddr
intoIpAddr
and port components and to build one out of these components. It we're going to removeIpAddr
then shouldn'tSocketAddr
be removed aswell? It's very odd to not have a type for generic IP addresses but to have one for generic IP address + port.There's also at least one place in the standard library itself where
IpAddr
is needed. Thelookup_host
function returns an iterator ofSocketAddr
s with a dummy port because it doesn't have IP address type to use.The deprecation notice describes
IpAddr
as being "too small to pull it's weight". Isn't being small a good thing? A type that only takes up a few lines of code doesn't come with much maintainance burden. Surely it's large, complicated types that implement specialised functionality that deserve to be spun off into their own libraries?Can we just put
IpAddr
back?The text was updated successfully, but these errors were encountered: