<p dir="auto">A small app to demonstrate the problem:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn test(val: u8) {
  match val {
    256 =&gt; print!(&quot;0b1110\n&quot;),
    512 =&gt; print!(&quot;0b1111\n&quot;),
    _   =&gt; print!(&quot;fail\n&quot;),
  }
}

fn main() {
  test(1);
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">:</span> <span class="pl-smi">u8</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">match</span> val <span class="pl-kos">{</span>
    <span class="pl-c1">256</span> =&gt; <span class="pl-en">print</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"0b1110<span class="pl-cce">\n</span>"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-c1">512</span> =&gt; <span class="pl-en">print</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"0b1111<span class="pl-cce">\n</span>"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    _   =&gt; <span class="pl-en">print</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"fail<span class="pl-cce">\n</span>"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</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-en">test</span><span class="pl-kos">(</span><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">Compilation fails in llvm:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="% rustc test.rs
test.rs:3:5: 3:11 warning: literal out of range for its type, #[warn(type_overflow)] on by default
test.rs:3     256 =&gt; print!(&quot;0b1110\n&quot;),
              ^~~~~~
test.rs:4:5: 4:11 warning: literal out of range for its type, #[warn(type_overflow)] on by default
test.rs:4     512 =&gt; print!(&quot;0b1111\n&quot;),
              ^~~~~~
Duplicate integer as switch case
  switch i8 %1, label %match_else [
    i8 0, label %match_case
    i8 0, label %match_case3
  ]
i8 0
LLVM ERROR: Broken function found, compilation aborted!"><pre class="notranslate"><code class="notranslate">% rustc test.rs
test.rs:3:5: 3:11 warning: literal out of range for its type, #[warn(type_overflow)] on by default
test.rs:3     256 =&gt; print!("0b1110\n"),
              ^~~~~~
test.rs:4:5: 4:11 warning: literal out of range for its type, #[warn(type_overflow)] on by default
test.rs:4     512 =&gt; print!("0b1111\n"),
              ^~~~~~
Duplicate integer as switch case
  switch i8 %1, label %match_else [
    i8 0, label %match_case
    i8 0, label %match_case3
  ]
i8 0
LLVM ERROR: Broken function found, compilation aborted!
</code></pre></div>
<p dir="auto">Rustc should detect the double label due to overflow.</p>
<p dir="auto"><code class="notranslate">fail</code> is becoming a macro as per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7233772" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/3627" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/3627/hovercard" href="https://github.com/rust-lang/rust/issues/3627">#3627</a>, but first all uses of the <code class="notranslate">fail</code> keyword must be removed. There's a new macro named <code class="notranslate">die!</code> that can do the job of <code class="notranslate">fail</code>. Make the switch, then remove the <code class="notranslate">fail</code> keyword from the parser and mass-rename <code class="notranslate">die!</code> to <code class="notranslate">fail!</code>.</p>