Skip to content

General nits #14773

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libnative/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn unimpl() -> IoError {
IoError {
code: ERROR as uint,
extra: 0,
detail: None,
detail: Some("not yet supported by the `native` runtime, maybe try `green`.".to_string()),
}
}

Expand Down
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
Copy link
Member

Choose a reason for hiding this comment

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

Another possibility would be no_run which just runs the analysis passes (no need to change, just an option).

# #![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