Skip to content

Commit

Permalink
Rollup merge of rust-lang#58551 - ssomers:master, r=oli-obk
Browse files Browse the repository at this point in the history
Explain a panic in test case net::tcp::tests::double_bind

Those who try to build libstd on the Windows Subsystem for Linux experience a single failing test, where the point of failure is an explicit but anonymous panic, as reported in rust-lang#49367
This commit somewhat explains why and allows diagnosing a little.
  • Loading branch information
kennytm committed Feb 20, 2019
2 parents 8368638 + 01bebdf commit ef0aadd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,13 @@ mod tests {
#[test]
fn double_bind() {
each_ip(&mut |addr| {
let _listener = t!(TcpListener::bind(&addr));
let listener1 = t!(TcpListener::bind(&addr));
match TcpListener::bind(&addr) {
Ok(..) => panic!(),
Ok(listener2) => panic!(
"This system (perhaps due to options set by TcpListener::bind) \
permits double binding: {:?} and {:?}",
listener1, listener2
),
Err(e) => {
assert!(e.kind() == ErrorKind::ConnectionRefused ||
e.kind() == ErrorKind::Other ||
Expand Down

0 comments on commit ef0aadd

Please sign in to comment.