<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
  assert!([1i].len() &gt; -1);
}"><pre class="notranslate"><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-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span>i<span class="pl-kos">]</span>.len<span class="pl-kos">(</span><span class="pl-kos">)</span> &gt; -<span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This assertion incorrectly fails.</p>
<p dir="auto">The compiler should show a warning message when is used a negative number into a like-uint type</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let n: u8 = -1;
println!(&quot;{}&quot;, n); // =&gt; 255"><pre class="notranslate"><span class="pl-k">let</span> n<span class="pl-kos">:</span> <span class="pl-smi">u8</span> = -<span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, n<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// =&gt; 255</span></pre></div>