Rollup merge of #58551 - ssomers:master, r=oli-obk

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 https://github.com/rust-lang/rust/issues/49367
This commit somewhat explains why and allows diagnosing a little.
This commit is contained in:
kennytm 2019-02-20 01:13:36 +08:00
commit ef0aaddf69
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -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 ||