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] 10 #[cfg_attr(miri, ignore)] // No `socket` in miri. no_runtime_panics_binding_net_tcp_listener()11fn no_runtime_panics_binding_net_tcp_listener() { 12 let listener = net::TcpListener::bind("127.0.0.1:0").expect("failed to bind listener"); 13 let _ = TcpListener::try_from(listener); 14 } 15