Closed
Description
I can't match using a constant that was initialized using a byte string literal:
const ARRAY1: [u8; 0] = [];
const ARRAY2: [u8; 0] = *b"";
fn main() {
match [] {
ARRAY1 => {}
ARRAY2 => {}
}
}
This gets an error:
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 => {}
^~~~~~
a.rs:2:25: 2:29 error: unsupported constant expr
a.rs:2 const ARRAY2: [u8; 0] = *b"";
^~~~
Metadata
Metadata
Assignees
Labels
No labels