summaryrefslogtreecommitdiffstats
path: root/tokio/tests/net_bind_resource.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-10-25 12:50:15 -0700
committerGitHub <noreply@github.com>2019-10-25 12:50:15 -0700
commit227533d456fe32e48ffcd3796f1e6c8f9318b230 (patch)
tree498029aaf42dd64eeb8ef0e7d7f29802b45d4e95 /tokio/tests/net_bind_resource.rs
parent03a9378297c73c2e56a6d6b55db22b92427b850a (diff)
net: move into tokio crate (#1683)
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
Diffstat (limited to 'tokio/tests/net_bind_resource.rs')
-rw-r--r--tokio/tests/net_bind_resource.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tokio/tests/net_bind_resource.rs b/tokio/tests/net_bind_resource.rs
new file mode 100644
index 00000000..bb507fcc
--- /dev/null
+++ b/tokio/tests/net_bind_resource.rs
@@ -0,0 +1,11 @@
+use tokio::net::TcpListener;
+
+use std::convert::TryFrom;
+use std::net;
+
+#[test]
+#[should_panic]
+fn no_runtime_panics_binding_net_tcp_listener() {
+ let listener = net::TcpListener::bind("127.0.0.1:0").expect("failed to bind listener");
+ let _ = TcpListener::try_from(listener);
+}