-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement concat_bytes! #87599
Implement concat_bytes! #87599
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Just pointing out that the RFC contains a bit of a contradiction and this PR's tests don't appear to test that case: rust-lang/rfcs#2509 (comment) |
@Fishrock123 That appears to have been an oversight when updating the RFC. I've added a test for it. |
Rerolling r? rust-lang/compiler |
Looks like this is ready for review |
The tracking issue for this is rust-lang#87555.
c1cc810
to
eb56693
Compare
Squashed commits, looks good to me, thanks! @bors r+ |
📌 Commit eb56693 has been approved by |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#87599 (Implement concat_bytes!) - rust-lang#89999 (Update std::env::temp_dir to use GetTempPath2 on Windows when available.) - rust-lang#90796 (Remove the reg_thumb register class for asm! on ARM) - rust-lang#91042 (Use Vec extend instead of repeated pushes on several places) - rust-lang#91634 (Do not attempt to suggest help for overly malformed struct/function call) - rust-lang#91685 (Install llvm tools to sysroot when assembling local toolchain) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This implements the unstable
concat_bytes!
macro, which has tracking issue #87555. It can be used like:If strings or characters are used where byte strings or byte characters are required, it suggests adding a
b
prefix. If a number is used outside of an array it suggests arrayifying it. If a boolean is used it suggests replacing it with the numeric value of that number. Doubly nested arrays of bytes are disallowed.