-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.