Skip to content

Conversation

taksyon
Copy link

@taksyon taksyon commented Sep 7, 2025

Addresses starting with "192.0.2.", "198.51.100.", or "203.0.113." are reserved for use in documentation and sample configurations. The original was some random french IP, just changed it to an address reserved for documentation by the Internet Assigned Numbers Authority

Addresses starting with "192.0.2.", "198.51.100.", or "203.0.113." are reserved for use in documentation and sample configurations. 
The original was some random french IP
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 7, 2025
@hkBst
Copy link
Member

hkBst commented Sep 7, 2025

https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#method.is_global documents such addresses as not being global, so I expect the doc test to fail.

@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: rust_out::main::_doctest_main_library_core_src_net_ip_addr_rs_291_0
   5: rust_out::main
   6: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- library/core/src/net/ip_addr.rs - net::ip_addr::IpAddr::is_global (line 291) stdout end ----

@hkBst
Copy link
Member

hkBst commented Sep 7, 2025

According to https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml, these special addresses are global:

192.175.48.0/24 	Direct Delegation AS112 Service 	[[RFC7534](https://www.iana.org/go/rfc7534)] 	1996-01 	N/A 	True 	True 	True 	True 	False
192.52.193.0/24 	AMT 	[[RFC7450](https://www.iana.org/go/rfc7450)] 	2014-12 	N/A 	True 	True 	True 	True 	False
192.31.196.0/24 	AS112-v4 	[[RFC7535](https://www.iana.org/go/rfc7535)] 	2014-12 	N/A 	True 	True 	True 	True 	False
192.0.0.10/32 	Traversal Using Relays around NAT Anycast 	[[RFC8155](https://www.iana.org/go/rfc8155)] 	2017-02 	N/A 	True 	True 	True 	True 	False
192.0.0.9/32 	Port Control Protocol Anycast 	[[RFC7723](https://www.iana.org/go/rfc7723)] 	2015-10 	N/A 	True 	True 	True 	True 	False

@taksyon
Copy link
Author

taksyon commented Sep 7, 2025

seems like this is an awkward method to write good docs for in that case...

@tgross35
Copy link
Contributor

tgross35 commented Sep 7, 2025

IPs have a one-hot classification, being a documentation IP means it isn't global https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=4d02d0c8fe5827b36b87a3b9dbbc0605. Based on the comment from @hkBst this also seems like a correct classification for the two IPs in question here.

seems like this is an awkward method to write good docs for in that case...

What makes the docs incorrect or bad?

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants