]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #77227 - oli-obk:const_val_🌳_prelude, r=RalfJung
authorbors <bors@rust-lang.org>
Wed, 4 Nov 2020 14:26:03 +0000 (14:26 +0000)
committerbors <bors@rust-lang.org>
Wed, 4 Nov 2020 14:26:03 +0000 (14:26 +0000)
Refactorings in preparation for const value trees

cc #72396

This PR changes the `Scalar::Bits { data: u128, size: u8 }` variant to `Scalar::Bits(ScalarInt)` where `ScalarInt` contains the same information, but is `repr(packed)`. The reason for using a packed struct is to allow enum variant packing to keep the original size of `Scalar` instead of adding another word to its size due to padding.
Other than that the PR just gets rid of all the inspection of the internal fields of `Scalar::Bits` which were frankly scary. These fields have invariants that we need to uphold and we can't do that without making the fields private.

r? `@ghost`


Trivial merge