3 ms·
I haven't looked at libstd, so I can't comment to that specifically. But we don't reorder two-field structs. Rustc special cases them in a lot of places to do
by CAMLORN 9y ago
I haven't looked at libstd, so I can't comment to that specifically. But we don't reorder two-field structs.
Rustc special cases them in a lot of places to do things that I will not even pretend to understand, and not reordering 2-element structs keeps them working. Since this already took 6 months of my free time (I have a lot of free time, though not 40 hours a week admittedly), this was for the best.
You can make an argument that we should have, but it doesn't matter from the user's perspective. (a, b) is the same size as (b, a) no matter what a and b are.