<p dir="auto">I can't match using a constant that was initialized using a byte string literal:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ARRAY1: [u8; 0] = [];
const ARRAY2: [u8; 0] = *b&quot;&quot;;

fn main() {
    match [] {
        ARRAY1 =&gt; {}
        ARRAY2 =&gt; {}
    }
}"><pre class="notranslate"><code class="notranslate">const ARRAY1: [u8; 0] = [];
const ARRAY2: [u8; 0] = *b"";

fn main() {
    match [] {
        ARRAY1 =&gt; {}
        ARRAY2 =&gt; {}
    }
}
</code></pre></div>
<p dir="auto">This gets an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a.rs:2:25: 2:29 error: constant evaluation error: unsupported constant expr
a.rs:2 const ARRAY2: [u8; 0] = *b&quot;&quot;;
                               ^~~~
a.rs:7:9: 7:15 note: in pattern here
a.rs:7         ARRAY2 =&gt; {}
               ^~~~~~
a.rs:2:25: 2:29 error: unsupported constant expr
a.rs:2 const ARRAY2: [u8; 0] = *b&quot;&quot;;
                               ^~~~"><pre class="notranslate"><code class="notranslate">a.rs:2:25: 2:29 error: constant evaluation error: unsupported constant expr
a.rs:2 const ARRAY2: [u8; 0] = *b"";
                               ^~~~
a.rs:7:9: 7:15 note: in pattern here
a.rs:7         ARRAY2 =&gt; {}
               ^~~~~~
a.rs:2:25: 2:29 error: unsupported constant expr
a.rs:2 const ARRAY2: [u8; 0] = *b"";
                               ^~~~
</code></pre></div>
<p dir="auto">Constants that dereference string literals cannot be currently used for pattern matching as show <a href="http://is.gd/F13Q7Q" rel="nofollow">below</a>:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const A: [u8; 4] = *b&quot;fooo&quot;;

fn main() {
    match *b&quot;xxxx&quot; {
        A =&gt; {},
        _ =&gt; {}
    }
}"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-v">A</span><span class="pl-kos">:</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">;</span> <span class="pl-c1">4</span><span class="pl-kos">]</span> = <span class="pl-c1">*</span><span class="pl-s">b"fooo"</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-k">match</span> <span class="pl-c1">*</span><span class="pl-s">b"xxxx"</span> <span class="pl-kos">{</span>
        <span class="pl-v">A</span> =&gt; <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
        _ =&gt; <span class="pl-kos">{</span><span class="pl-kos">}</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Such constants can be used in other contexts without any problem. It is inconsistent, and a very prominent use case is missing.</p>