title: error: the type of this value must be known in this context
body: <p>I'm writing a simple TCP chat engine to learn Rust.</p>
  
  <pre><code>use std::io::{TcpListener, TcpStream};
  use std::io::{Acceptor, Listener};
  
  enum StreamOrSlice {
       Strm(TcpStream),
       Slc(uint, [u8, ..1024])
  }
  
  fn main() {
      let listener = TcpListener::bind("127.0.0.1", 5555);
  
      // bind the listener to the specified address
      let mut acceptor = listener.listen();
  
      let (tx, rx) = channel();
  
      spawn(proc() {
          let mut streams: Vec&lt;TcpStream&gt; = Vec::new();
          match rx.recv() {
              Strm(mut stream) =&gt; {
                  streams.push(stream);
              }
              Slc(len, buf) =&gt; {
                  for stream in streams.iter() {
                      stream.write(buf.slice(0, len));
                  }
              }
          }
      });
  
      // accept connections and process them, spawning a new tasks for each one
      for stream in acceptor.incoming() {
          match stream {
              Err(e) =&gt; { /* connection failed */ }
              Ok(mut stream) =&gt; {
                  // connection succeeded
                  tx.send(Strm(stream.clone()));
                  let tx2 = tx.clone();
                  spawn(proc() {
                      let mut buf: [u8, ..1024] = [0, ..1024];
                      loop {
                          let len = stream.read(buf);
                          tx2.send(Slc(len.unwrap(), buf));
                      }
                  })
              }
          }
      }
  }
  </code></pre>
  
  <p>The above code fails to compile with:</p>
  
  <pre><code>   Compiling chat v0.1.0 (file:///home/chris/rust/chat)
  src/chat.rs:20:13: 20:29 error: the type of this value must be known in this context
  src/chat.rs:20             Strm(mut stream) =&gt; {
                             ^~~~~~~~~~~~~~~~
  error: aborting due to previous error
  Could not compile `chat`.
  </code></pre>
  
  <p>What is the reason for this?</p>
  
  <p>The type of the value <em>is</em> known, it's declared in the <code>enum</code> as <code>TcpStream</code>.</p>
  
  <p>How can I fix this code?</p>