<p dir="auto">The following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="static ASCII_SPACE: u8 = b' ';
static ASCII_SAVE_MIN: u8 = 33;
static ASCII_SAVE_MAX: u8 = 255;

fn parse_byte(c: u8) {
    match c {
        ASCII_SAVE_MIN .. ASCII_SAVE_MAX =&gt; { },
        ASCII_SPACE =&gt; { },
        _ =&gt; { }
    };
}

fn main() { }"><pre class="notranslate"><code class="notranslate">static ASCII_SPACE: u8 = b' ';
static ASCII_SAVE_MIN: u8 = 33;
static ASCII_SAVE_MAX: u8 = 255;

fn parse_byte(c: u8) {
    match c {
        ASCII_SAVE_MIN .. ASCII_SAVE_MAX =&gt; { },
        ASCII_SPACE =&gt; { },
        _ =&gt; { }
    };
}

fn main() { }
</code></pre></div>
<p dir="auto">results in this compiler error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:7:9: 7:41 error: mismatched types between arms
&lt;anon&gt;:7         ASCII_SAVE_MIN .. ASCII_SAVE_MAX =&gt; { },
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101"><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:7:9: 7:41 error: mismatched types between arms
&lt;anon&gt;:7         ASCII_SAVE_MIN .. ASCII_SAVE_MAX =&gt; { },
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
</code></pre></div>
<p dir="auto">Changing the literal for ASCII_SPACE makes it compile:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- static ASCII_SPACE: u8 = b' ';
+ static ASCII_SPACE: u8 = 22;"><pre class="notranslate"><code class="notranslate">- static ASCII_SPACE: u8 = b' ';
+ static ASCII_SPACE: u8 = 22;
</code></pre></div>
<p dir="auto">I would guess it doesn't go (properly) through const eval, causing weird errors like this one:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="static MAX: uint = -1;
match 0 {
    1u..MAX =&gt; {}, // error: mismatched types in range
    _ =&gt; {}
}"><pre class="notranslate"><span class="pl-k">static</span> <span class="pl-v">MAX</span><span class="pl-kos">:</span> <span class="pl-smi">uint</span> = -<span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">match</span> <span class="pl-c1">0</span> <span class="pl-kos">{</span>
    <span class="pl-c1">1</span>u..<span class="pl-v">MAX</span> =&gt; <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// error: mismatched types in range</span>
    _ =&gt; <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">If the value of <code class="notranslate">MAX</code> is changed to <code class="notranslate">-1u</code>, the code compiles, showing that match checking looks at the value of the <code class="notranslate">static MAX</code> but not at its type or computed value.</p>
<p dir="auto">Further experimentation - using <code class="notranslate">-1 as uint</code> for <code class="notranslate">MAX</code> - produces this ICE:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: internal compiler error: node_id_to_type: no type for node `expr -1 as uint (id=26)`"><pre class="notranslate">error<span class="pl-kos">:</span> internal compiler error<span class="pl-kos">:</span> node_id_to_type<span class="pl-kos">:</span> no type <span class="pl-k">for</span> node `expr -<span class="pl-c1">1</span> as uint <span class="pl-kos">(</span>id=<span class="pl-c1">26</span><span class="pl-kos">)</span>`</pre></div>