Skip to content

Commit

Permalink
std: adjust the TCP io doc example to work reliably.
Browse files Browse the repository at this point in the history
Fixes rust-lang#11576 by making the code never run (and hence never
pass when the test was marked `should_fail`).
  • Loading branch information
huonw authored and mcpherrinm committed Jun 10, 2014
1 parent 79b3b3f commit 48eaa14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48eaa14

Please sign in to comment.