Skip to content

Commit 5652ccb

Browse files
committed
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](rust-lang/rust#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
2 parents b52fb52 + 8b25e53 commit 5652ccb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/ui/large_enum_variant.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ struct Struct2 {
101101
#[derive(Copy, Clone)]
102102
enum CopyableLargeEnum {
103103
A(bool),
104-
B([u128; 4000]),
104+
B([u64; 8000]),
105105
}
106106

107107
enum ManuallyCopyLargeEnum {
108108
A(bool),
109-
B([u128; 4000]),
109+
B([u64; 8000]),
110110
}
111111

112112
impl Clone for ManuallyCopyLargeEnum {

tests/ui/large_enum_variant.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ error: large size difference between variants
167167
LL | / enum CopyableLargeEnum {
168168
LL | | A(bool),
169169
| | ------- the second-largest variant contains at least 1 bytes
170-
LL | | B([u128; 4000]),
171-
| | --------------- the largest variant contains at least 64000 bytes
170+
LL | | B([u64; 8000]),
171+
| | -------------- the largest variant contains at least 64000 bytes
172172
LL | | }
173173
| |_^ the entire enum is at least 64008 bytes
174174
|
@@ -180,17 +180,17 @@ LL | enum CopyableLargeEnum {
180180
help: consider boxing the large fields to reduce the total size of the enum
181181
--> $DIR/large_enum_variant.rs:104:5
182182
|
183-
LL | B([u128; 4000]),
184-
| ^^^^^^^^^^^^^^^
183+
LL | B([u64; 8000]),
184+
| ^^^^^^^^^^^^^^
185185

186186
error: large size difference between variants
187187
--> $DIR/large_enum_variant.rs:107:1
188188
|
189189
LL | / enum ManuallyCopyLargeEnum {
190190
LL | | A(bool),
191191
| | ------- the second-largest variant contains at least 1 bytes
192-
LL | | B([u128; 4000]),
193-
| | --------------- the largest variant contains at least 64000 bytes
192+
LL | | B([u64; 8000]),
193+
| | -------------- the largest variant contains at least 64000 bytes
194194
LL | | }
195195
| |_^ the entire enum is at least 64008 bytes
196196
|
@@ -202,8 +202,8 @@ LL | enum ManuallyCopyLargeEnum {
202202
help: consider boxing the large fields to reduce the total size of the enum
203203
--> $DIR/large_enum_variant.rs:109:5
204204
|
205-
LL | B([u128; 4000]),
206-
| ^^^^^^^^^^^^^^^
205+
LL | B([u64; 8000]),
206+
| ^^^^^^^^^^^^^^
207207

208208
error: large size difference between variants
209209
--> $DIR/large_enum_variant.rs:120:1

0 commit comments

Comments
 (0)