2020-06-20 05:30:12 -05:00
|
|
|
// run-rustfix
|
|
|
|
use std::net::TcpListener;
|
|
|
|
|
|
|
|
struct NoToSocketAddrs(String);
|
|
|
|
|
|
|
|
impl std::ops::Deref for NoToSocketAddrs {
|
|
|
|
type Target = String;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
&self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _works = TcpListener::bind("some string");
|
|
|
|
let bad = NoToSocketAddrs("bad".to_owned());
|
|
|
|
let _errors = TcpListener::bind(&bad);
|
2020-09-02 02:40:56 -05:00
|
|
|
//~^ ERROR the trait bound `NoToSocketAddrs: ToSocketAddrs` is not satisfied
|
2020-06-20 05:30:12 -05:00
|
|
|
}
|