title: Type mismatch when returning from inside if statement
body: <p>The following code fails to compile:</p>
  
  <pre><code>fn testing() -&gt; i32 {
      let x = 5;
      if x == 5 {
          5
      }
      6
  }
  </code></pre>
  
  <p>with this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error E0308: mismatched types. (expected (), found integral variable)
  </code></pre>
  
  <p>If I put an explicit <code>return</code> in front of the <code>5</code>, or if I put the <code>6</code> inside an <code>else</code> block, everything works fine. What exactly is Rust complaining about?</p>