diff --git a/hex-literal/CHANGELOG.md b/hex-literal/CHANGELOG.md index 43edcac4..46e77e34 100644 --- a/hex-literal/CHANGELOG.md +++ b/hex-literal/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - More tests for `hex!()` macro - More internal documentation +### Fixed +- Make `hex!()` error when forward slash encountered as last byte + ## 0.3.3 (2021-07-17) ### Added - Accept sequence of string literals ([#519]) diff --git a/hex-literal/src/comments.rs b/hex-literal/src/comments.rs index 02dd6993..135e6d53 100644 --- a/hex-literal/src/comments.rs +++ b/hex-literal/src/comments.rs @@ -28,6 +28,8 @@ impl> Iterator for ExcludingComments { State::BlockComment | State::PotentiallyLeavingBlockComment => { panic!("block comment not terminated with */") } + // No more bytes after a single '/' + State::PotentialComment { .. } => panic!("encountered invalid character: `/`"), _ => {} } }