Equivalent of constexpr from C++? : <p>See this code:</p>

<pre><code>fn main() {
    let something_const = 42;
    fn multiply(nbr: i32) -&gt; i32 {
        nbr * something_const
    }
    println!("{}", multiply(1));
}
</code></pre>

<p><code>rustc</code> outputs that</p>

<pre class="lang-none prettyprint-override"><code>error[E0434]: can't capture dynamic environment in a fn item; use the || { ... } closure form instead
  --&gt; main.rs:19:15
   |
19 |         nbr * something_const
   |               ^^^^^^^^^^^^^^^
</code></pre>

<p>But <code>something_const</code> is not dynamic, because it is known at compile time.</p>

<p>Is it an equivalent in Rust of the C++ <code>constexpr</code> mechanism?</p>
