title: Why can't I take the reference of the result of try! with &?
body: <p>It's not exactly an idiomatic MVCE, but it should illustrate the question. Given the following code:</p>
  
  <pre><code>fn foo() -&gt; Result&lt;String, i32&gt; {
      return Ok("world".to_string());
  }
  
  fn bar() -&gt; Result&lt;String, i32&gt; {
      let mut value = String::new();
      value.push_str(&amp;try!(foo())); // this line here
  
      return Ok("Hello ".to_string() + &amp;value);
  }
  
  fn main() {
      match bar() {
          Ok(message) =&gt; println!("{}", message),
          _ =&gt; return,
      }
  }
  </code></pre>
  
  <p>Rust returns the error:</p>
  
  <blockquote>
    <p><code>&lt;std macros&gt;:3:43: 3:46</code> error: mismatched types:<br>
    expected <code>str</code>,<br>
    found <code>collections::string::String</code><br>
    (expected <code>str</code>,<br>
    found struct <code>collections::string::String</code>) [E0308]<br>
    <code>&lt;std macros&gt;:3 $ crate:: result:: Result:: Ok ( val ) =&gt; val , $ crate:: result:: Result::</code><br>
    <code>&lt;std macros&gt;:1:1: 6:48</code> note: in expansion of <code>try!</code><br>
    <code>&lt;std macros&gt;:3:43: 3:46</code> help: run <code>rustc --explain E0308</code> to see a detailed explanation<br>
    error: aborting due to previous error</p>
  </blockquote>
  
  <p>If I instead capture the result of <code>try!</code> and separately apply <code>&amp;</code> to the result, it works (and prints out <code>Hello world</code>):</p>
  
  <pre><code>fn foo() -&gt; Result&lt;String, i32&gt; {
      return Ok("world".to_string());
  }
  
  fn bar() -&gt; Result&lt;String, i32&gt; {
      let mut value = String::new();
      let foo_result = try!(foo()); // capture the result of try!
      value.push_str(&amp;foo_result); // now use the result with &amp;
  
      return Ok("Hello ".to_string() + &amp;value);
  }
  
  fn main() {
      match bar() {
          Ok(message) =&gt; println!("{}", message),
          _ =&gt; return,
      }
  }
  </code></pre>
  
  <p>Why does <code>let foo_result = try!(foo()); value.push_str(&amp;foo_result);</code> work but <code>value.push_str(&amp;try!(foo()));</code> not? From my naive perspective, they appear to be equivalent, so I'm not sure what key part of Rust I'm not understanding.</p>