From dd6a1c185921f9d0d9ff838556751c7a9079c3d0 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 10 Jun 2014 00:31:31 +1000 Subject: [PATCH 1/2] native: add more info to the native unimplemented error. This refers to green, which (AFAICT) has everything implemented. In particular, this will help guide people to get working signal handling via libgreen. --- src/libnative/io/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index 3b0dbe2d0dce9..4c5929ef2233f 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -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()), } } From 26cfc43868d4c444069f80cc0198cdb66147b07d Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 10 Jun 2014 00:33:04 +1000 Subject: [PATCH 2/2] 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`). --- src/libstd/io/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index c72cc0ded9bc3..f4e49161e5160 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