diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-06-10 00:33:04 +1000 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-09 17:46:53 -0700 |
| commit | 14668f2791c4893b84ae4111c52dee07c79faac7 (patch) | |
| tree | e4868b07cdb3e55272433e2924b7155c8ca563e9 /src/libstd | |
| parent | 05810604c8f1ecebe35a8676df7371487ec80513 (diff) | |
| download | rust-14668f2791c4893b84ae4111c52dee07c79faac7.tar.gz rust-14668f2791c4893b84ae4111c52dee07c79faac7.zip | |
std: adjust the TCP io doc example to work reliably.
Fixes #11576 by making the code never run (and hence never pass when the test was marked `should_fail`).
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 6f3eec01e8e..a1e0fa88978 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -81,13 +81,18 @@ Some examples of obvious things you might want to do * Make a simple TCP client connection and request - ```rust,should_fail + ```rust # #![allow(unused_must_use)] use std::io::net::tcp::TcpStream; + # // connection doesn't fail if a server is running on 8080 + # // locally, we still want to be type checking this code, so lets + # // just stop it running (#11576) + # if false { let mut socket = TcpStream::connect("127.0.0.1", 8080).unwrap(); socket.write(bytes!("GET / HTTP/1.0\n\n")); let response = socket.read_to_end(); + # } ``` * Make a simple TCP server |
