Skip to content

Commit 9560969

Browse files
committed
Update test for packed structs to also test being placed in statics.
1 parent 4b4b213 commit 9560969

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/run-pass/packed-struct-size.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ struct S7_Option {
5050
d: Option<@mut f64>
5151
}
5252

53+
// Placing packed structs in statics should work
54+
static TEST_S4: S4 = S4 { a: 1, b: [2, 3, 4] };
55+
static TEST_S5: S5 = S5 { a: 3, b: 67 };
56+
static TEST_S3_Foo: S3_Foo = S3_Foo { a: 1, b: 2, c: Baz };
57+
5358

5459
pub fn main() {
5560
assert_eq!(sys::size_of::<S4>(), 4);

0 commit comments

Comments
 (0)