mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 05:14:27 +00:00
Auto merge of #9448 - Alexendoo:large-enum-variant-u128, r=Manishearth
Replace u128 with u64 in large_enum_variant uitest A u128 has [an 8 byte alignment on x86](https://github.com/rust-lang/rust/issues/54341), but a 16 byte alignment on aarch64 which changes the size of the enums due to extra padding. This means the test fails on aarch64 changelog: none
This commit is contained in:
commit
5652ccbc0f
@ -101,12 +101,12 @@ struct Struct2 {
|
||||
#[derive(Copy, Clone)]
|
||||
enum CopyableLargeEnum {
|
||||
A(bool),
|
||||
B([u128; 4000]),
|
||||
B([u64; 8000]),
|
||||
}
|
||||
|
||||
enum ManuallyCopyLargeEnum {
|
||||
A(bool),
|
||||
B([u128; 4000]),
|
||||
B([u64; 8000]),
|
||||
}
|
||||
|
||||
impl Clone for ManuallyCopyLargeEnum {
|
||||
|
@ -167,8 +167,8 @@ error: large size difference between variants
|
||||
LL | / enum CopyableLargeEnum {
|
||||
LL | | A(bool),
|
||||
| | ------- the second-largest variant contains at least 1 bytes
|
||||
LL | | B([u128; 4000]),
|
||||
| | --------------- the largest variant contains at least 64000 bytes
|
||||
LL | | B([u64; 8000]),
|
||||
| | -------------- the largest variant contains at least 64000 bytes
|
||||
LL | | }
|
||||
| |_^ the entire enum is at least 64008 bytes
|
||||
|
|
||||
@ -180,8 +180,8 @@ LL | enum CopyableLargeEnum {
|
||||
help: consider boxing the large fields to reduce the total size of the enum
|
||||
--> $DIR/large_enum_variant.rs:104:5
|
||||
|
|
||||
LL | B([u128; 4000]),
|
||||
| ^^^^^^^^^^^^^^^
|
||||
LL | B([u64; 8000]),
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: large size difference between variants
|
||||
--> $DIR/large_enum_variant.rs:107:1
|
||||
@ -189,8 +189,8 @@ error: large size difference between variants
|
||||
LL | / enum ManuallyCopyLargeEnum {
|
||||
LL | | A(bool),
|
||||
| | ------- the second-largest variant contains at least 1 bytes
|
||||
LL | | B([u128; 4000]),
|
||||
| | --------------- the largest variant contains at least 64000 bytes
|
||||
LL | | B([u64; 8000]),
|
||||
| | -------------- the largest variant contains at least 64000 bytes
|
||||
LL | | }
|
||||
| |_^ the entire enum is at least 64008 bytes
|
||||
|
|
||||
@ -202,8 +202,8 @@ LL | enum ManuallyCopyLargeEnum {
|
||||
help: consider boxing the large fields to reduce the total size of the enum
|
||||
--> $DIR/large_enum_variant.rs:109:5
|
||||
|
|
||||
LL | B([u128; 4000]),
|
||||
| ^^^^^^^^^^^^^^^
|
||||
LL | B([u64; 8000]),
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: large size difference between variants
|
||||
--> $DIR/large_enum_variant.rs:120:1
|
||||
|
Loading…
Reference in New Issue
Block a user