crabtw/rust-bindgen — pull request #37 by Kroisse (2013-09-04 17:19:57+00:00)
Title: Fix that bindgen generated broken code for the C union

Previous code was generated incorrect functions these lead to wrong memory address.

Example code:
```rust
use std::cast;
use std::ptr;

struct Event {
_type: u32
}

fn main() {
let data = [0u8, 1u8, 0u8, 0u8];
let r = &data;
unsafe {
let p1: *Event = cast::transmute(ptr::to_unsafe_ptr(r));
let p2: *Event = cast::transmute(&ptr::to_unsafe_ptr(r));
let p3: *Event = cast::transmute_copy(&ptr::to_unsafe_ptr(r));

println(fmt!("%p", r));
println(fmt!("%p", p1));
println(fmt!("%p", p2));
println(fmt!("%p", p3));

println(fmt!("%? %?", *p1, *p2));
}
}
```

Result:
```
0x10b40a0fc
0x10b40a0fc
0x10b40a0c8
0x10b40a0fc
Event{_type: 256u32} Event{_type: 188784892u32}
```