Closed
Description
I tried this code:
pub fn a(c: char) -> bool {
c == 's' || c == 'm' || c == 'h' || c == 'd' || c == 'w'
}
pub fn b(c: char) -> bool {
matches!(c, 's' | 'm' | 'h' | 'd' | 'w')
}
When compiled with the latest stable version and look at the objdump, I see a combined version of a and b, because they are optimized to the same instructions and then merged in the library.
On nightly (already bisected) two copies are stored and it takes the double amount of space (3.9kIB vs 4.1kIB).
Here's a godbolt link: https://rust.godbolt.org/z/zWovojdEE
Version it worked on
It most recently worked on: 1.57.0
Doesn't work since: 63cc2bb cc #88243 @nikic
@rustbot modify labels: +regression-from-stable-to-nightly +I-heavy