]> git.lizzy.rs Git - rust.git/commit
handle mixed byte literal and byte array patterns
authorAriel Ben-Yehuda <ariel.byd@gmail.com>
Wed, 26 Oct 2016 19:38:22 +0000 (22:38 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Wed, 26 Oct 2016 20:10:30 +0000 (23:10 +0300)
commit8d3e89b484bbcd1c2fec60794c196d7148dd9f5b
tree184f6b4c9720acf8ea0316b3c9ec86f8cbccfc55
parent76fb7d90ecde3659021341779fea598a6daab013
handle mixed byte literal and byte array patterns

Convert byte literal pattern to byte array patterns when they are both
used together. so matching them is properly handled. I could've done the
conversion eagerly, but that could have caused a bad worst-case for
massive byte-array matches.

Fixes #18027.
Fixes #25051.
Fixes #26510.
src/librustc_const_eval/_match.rs
src/librustc_const_eval/check_match.rs
src/test/compile-fail/match-byte-array-patterns.rs [new file with mode: 0644]
src/test/run-pass/match-byte-array-patterns.rs [new file with mode: 0644]