summaryrefslogtreecommitdiff
path: root/rust/zerocopy/benches/transmute.rs
blob: e60bfb252f5cac9356735b9cd51adb59c64e9c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use zerocopy::Unalign;
use zerocopy_derive::*;

#[path = "formats/coco_static_size.rs"]
mod format;

#[derive(IntoBytes, KnownLayout, Immutable)]
#[repr(C)]
struct MinimalViableSource {
    bytes: [u8; 6],
}

#[unsafe(no_mangle)]
fn bench_transmute(source: MinimalViableSource) -> Unalign<format::LocoPacket> {
    zerocopy::transmute!(source)
}