puns 0.1.5

Type punning proven at compile time: a safe alternative to transmute and to hand-written parsing of bytes
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! No `&mut` to the bytes of a pointer: a null one would become one that aims at anything.
#[path = "../support/relative.rs"]
#[allow(dead_code)]
mod relative;
use relative::Opt;

fn main() {
  let mut none: Opt<u32> = Opt::none();
  let bytes: &mut [u8; 4] = puns::pun_mut(&mut none);
  bytes[0] = 4;
}