Closed
Description
Constants that dereference string literals cannot be currently used for pattern matching as show below:
const A: [u8; 4] = *b"fooo";
fn main() {
match *b"xxxx" {
A => {},
_ => {}
}
}
Such constants can be used in other contexts without any problem. It is inconsistent, and a very prominent use case is missing.