Skip to content
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

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

frewsxcv
Copy link
Member

Fixes #22569.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

/// a TCP connection to `127.0.0.1:8081`:
///
/// ```no_run
/// use std::net::TcpStream;
Copy link
Member

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)

/// TCP listener bound to `127.0.0.1:443`:
///
/// ```no_run
/// use std::net::TcpListener;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

@frewsxcv frewsxcv force-pushed the frewsxcv-addr-other-scenarios branch from 8a09fd2 to c548e51 Compare August 31, 2017 13:20
@frewsxcv
Copy link
Member Author

Imports fixed in the latest force push.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 31, 2017

📌 Commit c548e51 has been approved by alexcrichton

@frewsxcv
Copy link
Member Author

@bors rollup

@frewsxcv frewsxcv force-pushed the frewsxcv-addr-other-scenarios branch from c548e51 to 0a716fd Compare August 31, 2017 15:24
@frewsxcv
Copy link
Member Author

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)),

@bors
Copy link
Contributor

bors commented Aug 31, 2017

📌 Commit 0a716fd has been approved by alexcrichton

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 31, 2017
…ios, r=alexcrichton

Expand docs of multi-address behavior of some UDP/TCP APIs.

Fixes rust-lang#22569.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Sep 1, 2017
…ios, r=alexcrichton

Expand docs of multi-address behavior of some UDP/TCP APIs.

Fixes rust-lang#22569.
bors added a commit that referenced this pull request Sep 1, 2017
Rollup of 10 pull requests

- Successful merges: #44192, #44199, #44202, #44203, #44205, #44207, #44209, #44223, #44230, #44231
- Failed merges:
@bors
Copy link
Contributor

bors commented Sep 1, 2017

☔ The latest upstream changes (presumably #44233) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors merged commit 0a716fd into rust-lang:master Sep 1, 2017
@frewsxcv frewsxcv deleted the frewsxcv-addr-other-scenarios branch September 1, 2017 13:23
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 11, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 11, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 13, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 14, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 15, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants