<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[static_assert]
static X: bool = true;

fn main() {}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>static_assert<span class="pl-kos">]</span></span>
<span class="pl-k">static</span> <span class="pl-v">X</span><span class="pl-kos">:</span> <span class="pl-smi">bool</span> = <span class="pl-c1">true</span><span class="pl-kos">;</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="static-assert.rs:2:1: 2:23 warning: code is never used: `X`, #[warn(dead_code)] on by default
static-assert.rs:2 static X: bool = true;
                   ^~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">static-assert.rs:2:1: 2:23 warning: code is never used: `X`, #[warn(dead_code)] on by default
static-assert.rs:2 static X: bool = true;
                   ^~~~~~~~~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">These might not be used directly in the rest of the code, but they are still serving a concrete purpose, i.e. they are being semantically used.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#[static_assert]
static a: bool = 1 == 1;

fn main() {
}"><pre class="notranslate"><code class="notranslate">#[static_assert]
static a: bool = 1 == 1;

fn main() {
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/tmp/sa.rs:2:1: 2:25 warning: code is never used: `a`, #[warn(dead_code)] on by default
/tmp/sa.rs:2 static a: bool = 1 == 1;
             ^~~~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">/tmp/sa.rs:2:1: 2:25 warning: code is never used: `a`, #[warn(dead_code)] on by default
/tmp/sa.rs:2 static a: bool = 1 == 1;
             ^~~~~~~~~~~~~~~~~~~~~~~~
</code></pre></div>