mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
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.
12 lines
285 B
Rust
12 lines
285 B
Rust
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);
|
|
}
|