Skip to content

Commit b79f718

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#49367 This commit somewhat explains why and allows diagnosing a little.
2 parents 4339b7f + 01bebdf commit b79f718

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libstd/net/tcp.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,13 @@ mod tests {
11871187
#[test]
11881188
fn double_bind() {
11891189
each_ip(&mut |addr| {
1190-
let _listener = t!(TcpListener::bind(&addr));
1190+
let listener1 = t!(TcpListener::bind(&addr));
11911191
match TcpListener::bind(&addr) {
1192-
Ok(..) => panic!(),
1192+
Ok(listener2) => panic!(
1193+
"This system (perhaps due to options set by TcpListener::bind) \
1194+
permits double binding: {:?} and {:?}",
1195+
listener1, listener2
1196+
),
11931197
Err(e) => {
11941198
assert!(e.kind() == ErrorKind::ConnectionRefused ||
11951199
e.kind() == ErrorKind::Other ||

0 commit comments

Comments
 (0)