about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2018-01-16 23:05:13 +0200
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2018-01-16 23:23:11 +0200
commit06e32d044d72bea2859d741b4d5bf8775e326185 (patch)
tree0429c624fd252ab182c416f4df26c0cdfda56e9c /src/rustllvm/RustWrapper.cpp
parente6072a7b3835f1875e81c9fd27799f9b20a0770c (diff)
downloadrust-06e32d044d72bea2859d741b4d5bf8775e326185.tar.gz
rust-06e32d044d72bea2859d741b4d5bf8775e326185.zip
avoid double-unsizing arrays in bytestring match lowering
The match lowering code, when lowering matches against bytestrings,
works by coercing both the scrutinee and the pattern to `&[u8]` and
then comparing them using `<[u8] as Eq>::eq`.

If the scrutinee is already of type `&[u8]`, then unsizing it is both
unneccessary and a trait error caught by the new and updated MIR typeck,
so this PR changes lowering to avoid doing that (match lowering tried to
avoid that before, but that attempt was quite broken).

Fixes #46920.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions