summary refs log tree commit diff
path: root/src/test/ui/span/issue-33884.rs
blob: cef123d697bcd6f42a5ae483a944f77e54b596dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// ignore-cloudabi no std::net support

use std::net::TcpListener;
use std::net::TcpStream;
use std::io::{self, Read, Write};

fn handle_client(stream: TcpStream) -> io::Result<()> {
    stream.write_fmt(format!("message received"))
    //~^ ERROR mismatched types
}

fn main() {
    if let Ok(listener) = TcpListener::bind("127.0.0.1:8080") {
        for incoming in listener.incoming() {
            if let Ok(stream) = incoming {
                handle_client(stream);
            }
        }
    }
}