Closed
Description
concat!()
doesn't work on bytestrings (why?). When trying it, it fails with:
1 | const FOO: &[u8] = concat!("foo", "bar");
| ^^^^^^^^^^^^^^^^^^^^^
| |
| expected slice, found str
| help: consider adding a leading `b`: `bconcat!("foo", "bar")`
|
= note: expected type `&'static [u8]`
found type `&'static str`
bconcat!()
sounds interesting, but it isn't documented, and the compiler doesn't accept it:
error: cannot find macro `bconcat!` in this scope
--> src/main.rs:1:20
|
1 | const FOO: &[u8] = bconcat!("foo", "bar");
| ^^^^^^^ help: you could try the macro: `concat`
I think the real fix here is that bconcat!()
should exist.