-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Expand docs of multi-address behavior of some UDP/TCP APIs. #44209
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
042f26d
to
3e96fd9
Compare
3e96fd9
to
8a09fd2
Compare
src/libstd/net/tcp.rs
Outdated
/// a TCP connection to `127.0.0.1:8081`: | ||
/// | ||
/// ```no_run | ||
/// use std::net::TcpStream; |
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.
The doc tests failed, SocketAddr
needs to be imported first.
[00:57:39] failures:
[00:57:39]
[00:57:39] ---- net/tcp.rs - net::tcp::TcpListener::bind (line 602) stdout ----
[00:57:39] error[E0433]: failed to resolve. Use of undeclared type or module `SocketAddr`
[00:57:39] --> net/tcp.rs:7:5
[00:57:39] |
[00:57:39] 7 | SocketAddr::from(([127, 0, 0, 1], 80)),
[00:57:39] | ^^^^^^^^^^ Use of undeclared type or module `SocketAddr`
[00:57:39]
[00:57:39] error[E0433]: failed to resolve. Use of undeclared type or module `SocketAddr`
[00:57:39] --> net/tcp.rs:8:5
[00:57:39] |
[00:57:39] 8 | SocketAddr::from(([127, 0, 0, 1], 443)),
[00:57:39] | ^^^^^^^^^^ Use of undeclared type or module `SocketAddr`
[00:57:39]
[00:57:39] thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:280:12
[00:57:39] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:57:39]
[00:57:39] ---- net/tcp.rs - net::tcp::TcpStream::connect (line 140) stdout ----
[00:57:39] error[E0433]: failed to resolve. Use of undeclared type or module `SocketAddr`
[00:57:39] --> net/tcp.rs:7:5
[00:57:39] |
[00:57:39] 7 | SocketAddr::from(([127, 0, 0, 1], 8080)),
[00:57:39] | ^^^^^^^^^^ Use of undeclared type or module `SocketAddr`
[00:57:39]
[00:57:39] error[E0433]: failed to resolve. Use of undeclared type or module `SocketAddr`
[00:57:39] --> net/tcp.rs:8:5
[00:57:39] |
[00:57:39] 8 | SocketAddr::from(([127, 0, 0, 1], 8081)),
[00:57:39] | ^^^^^^^^^^ Use of undeclared type or module `SocketAddr`
[00:57:39]
[00:57:39] thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:280:12
[00:57:39]
[00:57:39]
[00:57:39] failures:
[00:57:39] net/tcp.rs - net::tcp::TcpListener::bind (line 602)
[00:57:39] net/tcp.rs - net::tcp::TcpStream::connect (line 140)
src/libstd/net/tcp.rs
Outdated
/// TCP listener bound to `127.0.0.1:443`: | ||
/// | ||
/// ```no_run | ||
/// use std::net::TcpListener; |
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.
ditto.
8a09fd2
to
c548e51
Compare
Imports fixed in the latest force push. |
@bors: r+ |
📌 Commit c548e51 has been approved by |
@bors rollup |
c548e51
to
0a716fd
Compare
fixed another import issue @bors r=alexcrichton diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 2fb5d2b0ac..5467eff202 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -599,7 +599,7 @@ impl TcpListener {
/// TCP listener bound to `127.0.0.1:443`:
///
/// ```no_run
- /// use std::net::{SocketAddr, TcpStream};
+ /// use std::net::{SocketAddr, TcpListener};
///
/// let addrs = [
/// SocketAddr::from(([127, 0, 0, 1], 80)), |
📌 Commit 0a716fd has been approved by |
…ios, r=alexcrichton Expand docs of multi-address behavior of some UDP/TCP APIs. Fixes rust-lang#22569.
…ios, r=alexcrichton Expand docs of multi-address behavior of some UDP/TCP APIs. Fixes rust-lang#22569.
☔ The latest upstream changes (presumably #44233) made this pull request unmergeable. Please resolve the merge conflicts. |
…=frewsxcv Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv rust-lang#22569 rust-lang#44209
…=frewsxcv Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv rust-lang#22569 rust-lang#44209
…=frewsxcv Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv rust-lang#22569 rust-lang#44209
…=frewsxcv Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv rust-lang#22569 rust-lang#44209
…=frewsxcv Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv rust-lang#22569 rust-lang#44209
Fixes #22569.