about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-06 11:30:48 -0700
committerbors <bors@rust-lang.org>2013-05-06 11:30:48 -0700
commita5891bebc132d4c373a5a5ffc93ba1bea2e8beb5 (patch)
tree9b7f948c6129b3f502a372ec25f3bd9bfdec3562
parentb6dea9d41df25f1c6a6a0444395a9b29c8081cbe (diff)
parent502817a9c19752cafcc270d9d3e5a5104ce2eac9 (diff)
downloadrust-a5891bebc132d4c373a5a5ffc93ba1bea2e8beb5.tar.gz
rust-a5891bebc132d4c373a5a5ffc93ba1bea2e8beb5.zip
auto merge of #6265 : sanxiyn/rust/xc-packed, r=nikomatsakis
-rw-r--r--src/librustc/metadata/encoder.rs1
-rw-r--r--src/test/auxiliary/packed.rs5
-rw-r--r--src/test/run-pass/packed-struct-size-xc.rs8
3 files changed, 14 insertions, 0 deletions
diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs
index 6a9c564f368..7db362c6920 100644
--- a/src/librustc/metadata/encoder.rs
+++ b/src/librustc/metadata/encoder.rs
@@ -819,6 +819,7 @@ fn encode_info_for_item(ecx: @EncodeContext,
         }
 
         encode_name(ecx, ebml_w, item.ident);
+        encode_attributes(ebml_w, item.attrs);
         encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
         encode_region_param(ecx, ebml_w, item);
 
diff --git a/src/test/auxiliary/packed.rs b/src/test/auxiliary/packed.rs
new file mode 100644
index 00000000000..478d51b540c
--- /dev/null
+++ b/src/test/auxiliary/packed.rs
@@ -0,0 +1,5 @@
+#[packed]
+struct S {
+    a: u8,
+    b: u32
+}
diff --git a/src/test/run-pass/packed-struct-size-xc.rs b/src/test/run-pass/packed-struct-size-xc.rs
new file mode 100644
index 00000000000..ddfc2b17aa7
--- /dev/null
+++ b/src/test/run-pass/packed-struct-size-xc.rs
@@ -0,0 +1,8 @@
+// xfail-fast
+// aux-build:packed.rs
+
+extern mod packed;
+
+fn main() {
+    assert_eq!(sys::size_of::<packed::S>(), 5);
+}