-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the niche optimisation if other enum variants are small enough
* Put the largest niche first * Add test from issue 63866 * Add test for enum of sized/unsized * Prefer fields that are already earlier in the struct
- Loading branch information
1 parent
6f9a8a7
commit ad758f8
Showing
5 changed files
with
237 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
print-type-size type: `E1`: 12 bytes, alignment: 4 bytes | ||
print-type-size discriminant: 1 bytes | ||
print-type-size variant `B`: 11 bytes | ||
print-type-size padding: 3 bytes | ||
print-type-size field `.0`: 8 bytes, alignment: 4 bytes | ||
print-type-size variant `A`: 7 bytes | ||
print-type-size field `.1`: 1 bytes | ||
print-type-size type: `E1`: 8 bytes, alignment: 4 bytes | ||
print-type-size variant `A`: 8 bytes | ||
print-type-size padding: 1 bytes | ||
print-type-size field `.1`: 1 bytes, alignment: 1 bytes | ||
print-type-size padding: 2 bytes | ||
print-type-size field `.0`: 4 bytes, alignment: 4 bytes | ||
print-type-size type: `E2`: 12 bytes, alignment: 4 bytes | ||
print-type-size discriminant: 1 bytes | ||
print-type-size variant `B`: 11 bytes | ||
print-type-size padding: 3 bytes | ||
print-type-size field `.0`: 8 bytes, alignment: 4 bytes | ||
print-type-size variant `A`: 7 bytes | ||
print-type-size field `.0`: 1 bytes | ||
print-type-size variant `B`: 8 bytes | ||
print-type-size field `.0`: 8 bytes | ||
print-type-size type: `E2`: 8 bytes, alignment: 4 bytes | ||
print-type-size variant `A`: 8 bytes | ||
print-type-size padding: 1 bytes | ||
print-type-size field `.0`: 1 bytes, alignment: 1 bytes | ||
print-type-size padding: 2 bytes | ||
print-type-size field `.1`: 4 bytes, alignment: 4 bytes | ||
print-type-size variant `B`: 8 bytes | ||
print-type-size field `.0`: 8 bytes | ||
print-type-size type: `S`: 8 bytes, alignment: 4 bytes | ||
print-type-size field `.g`: 4 bytes | ||
print-type-size field `.a`: 1 bytes | ||
print-type-size field `.b`: 1 bytes | ||
print-type-size end padding: 2 bytes | ||
print-type-size padding: 2 bytes | ||
print-type-size field `.g`: 4 bytes, alignment: 4 bytes |
Oops, something went wrong.