mozilla/rust — pull request #5758 by dbaupp (2013-04-06 12:41:46+00:00)
Title: Add #[packed] attribute to create packed structs

This adds a `#[packed]` attribute for structs, like GCC's `__attribute__((packed))`, e.g.

```rust
#[packed]
struct Size5 {
a: u8,
b: u32
}
```

It works on normal and tuple structs, but is (silently) ignored on enums.

Notes:
- I couldn't work out a better way to store the packed-ness of a struct than in `ty::sty`.
- I have no idea if this works on any architecture other than x86-64.

Closes #1704.