hex-literal: remove support for comments inside literals and migrate to CTFE#816
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.
This line may not be const-promoted (or const-evaluated), which may cause performance regression.
Potential breaking change for v1.0, see #814.