• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![warn(rust_2018_idioms)]
2 #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support panic recovery or bind
3 
4 use tokio::net::TcpListener;
5 
6 use std::net;
7 
8 #[test]
9 #[should_panic]
no_runtime_panics_binding_net_tcp_listener()10 fn no_runtime_panics_binding_net_tcp_listener() {
11     let listener = net::TcpListener::bind("127.0.0.1:0").expect("failed to bind listener");
12     let _ = TcpListener::try_from(listener);
13 }
14