about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-04 17:12:19 +0000
committerbors <bors@rust-lang.org>2015-05-04 17:12:19 +0000
commit70db76602e0fbd88c718e4f564b90a8819978773 (patch)
tree26ff11a665a56b3cf31d084344d574cb82c0a089 /src/rustllvm/ExecutionEngineWrapper.cpp
parenta979efc2f961c2cf8d7afa57b905e73349b8f476 (diff)
parent987eb28ecad144928bfc21e27777d443f56547de (diff)
downloadrust-70db76602e0fbd88c718e4f564b90a8819978773.tar.gz
rust-70db76602e0fbd88c718e4f564b90a8819978773.zip
Auto merge of #25078 - nham:std_net_impl_debug, r=alexcrichton
I'm uncertain whether the 3 implementations in `net2` should unwrap the socket address values. Without unwrapping it looks like this:

```
UdpSocket { addr: Ok(V4(127.0.0.1:34354)), inner: 3 }
TcpListener { addr: Ok(V4(127.0.0.1:9123)), inner: 4 }
TcpStream { addr: Ok(V4(127.0.0.1:9123)), peer: Ok(V4(127.0.0.1:58360)), inner: 5 }
```

One issue is that you can create, e.g. `UdpSocket`s with bad addresses, which means you can't just unwrap in the implementation:

```
#![feature(from_raw_os)]
use std::net::UdpSocket;
use std::os::unix::io::FromRawFd;

let sock: UdpSocket = unsafe { FromRawFd::from_raw_fd(-1) };
println!("{:?}", sock); // prints "UdpSocket { addr: Err(Error { repr: Os(9) }), inner: -1 }"

```

Fixes #23134.
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions