use IPV6 loopback and documentation address in documentation over V4 by default - #161879
use IPV6 loopback and documentation address in documentation over V4 by default#1618792ndDerivative wants to merge 8 commits into
Conversation
…v6 multicast_loop methods
My submission towards rust-lang#161832 I didn't touch any tests or anything that actually gets run for now, but if this is realistic Rust should probably default to using [::1] loopback for the std tests too.
|
Thanks for the pull request, and welcome! The Rust Project has assigned @joboet (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
|
This comment has been minimized.
This comment has been minimized.
|
I really don't have an opinion here, networking isn't my domain (pun intended). @rustbot reroll |
|
I admit I'm struggling to feel strongly about this either way. This does feel like a policy decision though:
@rust-lang/libs does anybody have thoughts on this? |
| /// use std::net::TcpStream; | ||
| /// | ||
| /// let mut stream = TcpStream::connect("127.0.0.1:34254").unwrap(); | ||
| /// let mut stream = TcpStream::connect("[::1]:34254").unwrap(); |
There was a problem hiding this comment.
How about keeping both versions side-by-side?
Many, for example me, aren't familiar with IPv6, having both will help me read the docs while bridge me into ipv6
| /// let mut stream = TcpStream::connect("[::1]:34254").unwrap(); | |
| /// let mut stream = TcpStream::connect("127.0.0.1:34254").unwrap(); // ipv4 | |
| /// let mut stream = TcpStream::connect("[::1]:34254").unwrap(); // ipv6 |
There was a problem hiding this comment.
would this be for every TcpStream::connect in the docs?
It's just the localhost address everywhere, but if the duplication is not a problem, sure! 👍🏻
There was a problem hiding this comment.
I like this idea, honestly. Since examples are also doctests, it makes sense to have "coverage" for these, I think.
There was a problem hiding this comment.
would I just redeclare the stream/whateverit'snamed variable on every doctest or how would we do that? :-)
There was a problem hiding this comment.
I mean, it would depend on the test, but you're welcome to use your own judgement. It would be fine to define both but only "use" the v6 one imo
There was a problem hiding this comment.
considering that adding both versions to every site where I changed it would be a lot of clutter, I suggest my newest change, which is adding an ipv4_x declaration to UdpSocket, TcpListener and TcpStream struct examples (meaning they show up on the top of the page in rustdoc)
|
I can take this over since I did the previous one. r? clarfonthey |
This comment has been minimized.
This comment has been minimized.
Personally I'm -0.75 – users are way more likely to encounter IPv4 at the time being, and likely for the foreseeable future. I don't think I've ever seen documentation anywhere use |
This defaults all documentation unrelated to specific IP versions to the current IPv6.
Related to issue #161832
I didn't touch any tests, as I'm pretty new and don't know much about the test infrastructure, but maybe it should be considered to run all the tests via the v6 loopback by default too.
Feel free to discuss and / or critique!