-
Notifications
You must be signed in to change notification settings - Fork 133
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
hex-literal: remove support for comments inside literals and migrate to CTFE #816
Conversation
@tarcieri |
@newpavlov sure! |
Hi, this change seem to have broken the usage of hex! in the match patterns, i.e.
throws now:
|
Unfortunately, I think it's inevitable with the CTFE approach until implementation of RFC 2920 will be stabilized. You can either continue to use v0.3, or introduce named constants and use them in patterns. |
I see, thank you. Will stick to the v0.3 for now |
Another small regression (which is easy enough to work around, but was convenient before): https://github.com/RustCrypto/SSH/actions/runs/4599840083/jobs/8125721544?pr=92#step:5:13
|
Yes, it's unfortunate. Though in such cases I usually use shorter |
macro_rules! hex { | ||
($($s:literal)*) => {{ | ||
const STRINGS: &[&'static [u8]] = &[$($s.as_bytes(),)*]; | ||
$crate::decode::<{ $crate::len(STRINGS) }>(STRINGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line may not be const-promoted (or const-evaluated), which may cause performance regression.
Potential breaking change for v1.0, see #814.