Skip to content

Instantly share code, notes, and snippets.

View d3npa's full-sized avatar
📡
宇宙人とスカイプ中

d3npa

📡
宇宙人とスカイプ中
View GitHub Profile
@d3npa
d3npa / 1_unions.rs
Last active February 27, 2021 02:41
[Solved] Surprising Alignment Behavior with unions (and more?) in Rust
use std::mem;
union IpAddr1 {
v4: u32,
v6: u128,
}
struct Host1 {
addr: IpAddr1,
_1: u32,

Keybase proof

I hereby claim:

  • I am d3npa on github.
  • I am d3npa (https://keybase.io/d3npa) on keybase.
  • I have a public key ASDzn50ig49lbf-JzRtnzGEvGZl1_gskRb1j94WIgRb2Fgo

To claim this, I am signing this object: