about summary refs log tree commit diff
path: root/src/test/debuginfo/packed-struct.rs
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-05-26 23:56:52 -0700
committerCorey Richardson <corey@octayn.net>2014-08-20 21:02:23 -0400
commit6e8ff999589a7b4c7f62f7128f3e028a7b3ea64f (patch)
tree71eb65a9aefa3503f15b4bd8245f36081f658c27 /src/test/debuginfo/packed-struct.rs
parent54bd9e6323742de87a526931a15558319db30604 (diff)
downloadrust-6e8ff999589a7b4c7f62f7128f3e028a7b3ea64f.tar.gz
rust-6e8ff999589a7b4c7f62f7128f3e028a7b3ea64f.zip
librustc: handle repr on structs, require it for ffi, unify with packed
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct
layout is now down with #[repr(C)]. For consistency, specifying a packed
layout is now also down with #[repr(packed)]. Both can be specified.

To fix errors caused by this, just add #[repr(C)] to the structs, and change
 #[packed] to #[repr(packed)]

Closes #14309

[breaking-change]
Diffstat (limited to 'src/test/debuginfo/packed-struct.rs')
-rw-r--r--src/test/debuginfo/packed-struct.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/debuginfo/packed-struct.rs b/src/test/debuginfo/packed-struct.rs
index 8201afe3a01..bf2213509cf 100644
--- a/src/test/debuginfo/packed-struct.rs
+++ b/src/test/debuginfo/packed-struct.rs
@@ -63,14 +63,14 @@
 
 #![allow(unused_variable)]
 
-#[packed]
+#[repr(packed)]
 struct Packed {
     x: i16,
     y: i32,
     z: i64
 }
 
-#[packed]
+#[repr(packed)]
 struct PackedInPacked {
     a: i32,
     b: Packed,
@@ -95,7 +95,7 @@ struct Unpacked {
 }
 
 // layout (64 bit): aabb bbbb bbbb bbbb bbbb bbbb bbcc cccc cccc cccc cccc cccc ccdd dddd dd
-#[packed]
+#[repr(packed)]
 struct UnpackedInPacked {
     a: i16,
     b: Unpacked,