title: "Sized is not implemented for the type str" when matching against a string literal?
body: <p>I'm having trouble with some Rust code. I have a fairly simple function, but it throws errors in code that seems to be unrelated:</p>
  
  <pre><code>use std::env::Args;
  fn without_xxx(args: Args) -&gt; Vec&lt;String&gt;{
      let mut out: Vec&lt;String&gt; = vec![];
      let mut xxx = false;
      for arg in args{
          match &amp;arg{
               "-" =&gt; xxx=true, //this line
              _ =&gt; out.push(arg.to_string())
          }
      }
      return out;
  }
  </code></pre>
  
  <p>If you comment out the marked line, there will be no error shown. However, with that simple line, it reveals this cryptic set of errors:</p>
  
  <pre><code>&lt;anon&gt;:7:9: 12:10 error: the trait `core::marker::Sized` is not implemented for the type `str` [E0277]
  &lt;anon&gt;: 7         for arg in args{
  &lt;anon&gt;: 8             match &amp;arg{
  &lt;anon&gt;: 9                 "-" =&gt; xxx=true,
  &lt;anon&gt;:10                 _ =&gt; out.push(arg.to_string())
  &lt;anon&gt;:11             }
  &lt;anon&gt;:12         }
  &lt;anon&gt;:7:9: 12:10 help: see the detailed explanation for E0277
  &lt;anon&gt;:7:9: 12:10 note: `str` does not have a constant size known at compile-time
  &lt;anon&gt;:7:9: 12:10 note: required by `core::option::Option::Some`
  &lt;anon&gt;:7:13: 7:16 error: the trait `core::marker::Sized` is not implemented for the type `str` [E0277]
  &lt;anon&gt;:7         for arg in args{
                       ^~~
  &lt;anon&gt;:7:13: 7:16 help: see the detailed explanation for E0277
  &lt;anon&gt;:7:13: 7:16 note: `str` does not have a constant size known at compile-time
  &lt;anon&gt;:7:13: 7:16 note: all local variables must have a statically known size
  &lt;anon&gt;:7:9: 12:10 error: type mismatch resolving `&lt;std::env::Args as core::iter::Iterator&gt;::Item == str`:
   expected struct `collections::string::String`,
      found str [E0271]
  &lt;anon&gt;: 7         for arg in args{
  &lt;anon&gt;: 8             match &amp;arg{
  &lt;anon&gt;: 9                 "-" =&gt; xxx=true,
  &lt;anon&gt;:10                 _ =&gt; out.push(arg.to_string())
  &lt;anon&gt;:11             }
  &lt;anon&gt;:12         }
  &lt;anon&gt;:7:9: 12:10 help: see the detailed explanation for E0271
  </code></pre>