-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove Ipv4Addr::is_ietf_protocol_assignment
#86439
Conversation
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
850648c
to
a26237e
Compare
check!("192.0.0.0", ietf_protocol_assignment); | ||
check!("192.0.0.255", ietf_protocol_assignment); | ||
check!("192.0.0.100", ietf_protocol_assignment); | ||
check!("192.0.0.0"); | ||
check!("192.0.0.255"); | ||
check!("192.0.0.100"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I had removed these lines entirely, but I decided to keep them as a check that these addresses are not global; is_global
should not return true for these addresses.
This comment has been minimized.
This comment has been minimized.
Thanks. If anyone ever does find a use for this function, we can always add it back again. @bors r+ |
📌 Commit a26237e has been approved by |
Rollup of 13 pull requests Successful merges: - rust-lang#86183 (Change environment variable getters to error recoverably) - rust-lang#86439 (Remove `Ipv4Addr::is_ietf_protocol_assignment`) - rust-lang#86509 (Move `os_str_bytes` to `sys::unix`) - rust-lang#86593 (Partially stabilize `const_slice_first_last`) - rust-lang#86936 (Add documentation for `Ipv6MulticastScope`) - rust-lang#87282 (Ensure `./x.py dist` adheres to `build.tools`) - rust-lang#87468 (Update rustfmt) - rust-lang#87504 (Update mdbook.) - rust-lang#87608 (Remove unused field `Session.system_library_path`) - rust-lang#87629 (Consistent spelling of "adapter" in the standard library) - rust-lang#87633 (Update compiler_builtins to fix i128 shift/mul on thumbv6m) - rust-lang#87644 (Recommend `swap_remove` in `Vec::remove` docs) - rust-lang#87653 (mark a UB doctest as no_run) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The is_unicast_site_local() method has been gone since Rust 1.55[1] and is_ietf_protocol_assignment() since 1.56[2]. I had to run this tool to test something, saw it wouldn't build with modern Rust. [1] rust-lang/rust#85820 [2] rust-lang/rust#86439
This PR removes the unstable method
Ipv4Addr::is_ietf_protocol_assignment
, as I suggested in #85612 (comment). The method was added in #60145, as far as I can tell primarily for the implementation ofIpv4Addr::is_global
(addresses reserved for IETF protocol assignment are not globally reachable unless otherwise specified).The method was added in 2019, but I haven't been able to find any open-source code using this method so far. I'm also having a hard time coming up with a usecase for specifically this method; knowing that an address is reserved for future protocols doesn't allow you to do much with it, especially since now some of those addresses are indeed assigned to a protocol and have their own behaviour (and might even be defined to be globally reachable, so if that is what you care about it is always more accurate to call
!is_global()
, instead ofis_ietf_protocol_assignment()
).Because of these reasons, I propose removing the method (or alternatively make it a private helper for
is_global
) and also not introduceIpv6Addr::is_ietf_protocol_assignment
andIpAddr::is_ietf_protocol_assignment
in the future.