title: error "type of this value must be known in this context" in pattern matching
body: <p>Consider the following example</p>
  
  <pre><code>fn main () {
      f("hello", true);
  }
  
  fn f(str: &amp;str, sen: bool) {
      let s: &amp;str = match sen {
          false =&gt; str,
          true =&gt; str.chars().map(|x| x.to_lowercase()).collect().as_slice()
      };
      println!("{}", s);
  }
  </code></pre>
  
  <p>I'm getting this error</p>
  
  <pre><code>error: the type of this value must be known in this conntext                                                                                                                                                              
  true =&gt; str.chars().map(|x| x.to_lowercase()).collect().as_slice()
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>I'm a bit confused, doesn't the compiler know that the type of <code>str</code> is <code>&amp;str</code> from the function definition? What am I missing here?</p>