title: Are semicolons optional in Rust?
body: <p>Since semicolons are apparently optional in Rust, why, if I do this:</p>
  
  <pre><code>fn fn1() -&gt; i32 {    
      let a = 1
      let b = 2
      3
  }
  </code></pre>
  
  <p>I get the error:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>error: expected one of `.`, `;`, `?`, or an operator, found `let`
   --&gt; src/main.rs:3:9
    |
  2 |         let a = 1
    |                  - expected one of `.`, `;`, `?`, or an operator here
  3 |         let b = 2
    |         ^^^ unexpected token
  </code></pre>