Make constant field access account for field reordering.
This commit is contained in:
parent
8cfbffea3b
commit
1969aeb3d7
2 changed files with 5 additions and 10 deletions
|
|
@ -26,9 +26,7 @@ fn main() {
|
|||
assert_eq!(size_of::<E>(), 1);
|
||||
assert_eq!(size_of::<Option<E>>(), 1);
|
||||
assert_eq!(size_of::<Result<E, ()>>(), 1);
|
||||
// The next asserts are correct given the currently dumb field reordering algorithm, which actually makes this struct larger.
|
||||
assert_eq!(size_of::<S>(), 6);
|
||||
assert_eq!(size_of::<Option<S>>(), 6);
|
||||
assert_eq!(size_of::<Option<S>>(), size_of::<S>());
|
||||
let enone = None::<E>;
|
||||
let esome = Some(E::A);
|
||||
if let Some(..) = enone {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue