summaryrefslogtreecommitdiffstats
path: root/tests/rust/union.rs
blob: b76f98ad110414915df6d8235d90642aad0b415d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::marker::PhantomData;

union Opaque {
    x: i32,
    y: f32,
}

#[repr(C)]
union Normal {
    x: i32,
    y: f32,
}

#[repr(C)]
union NormalWithZST {
    x: i32,
    y: f32,
    z: (),
    w: PhantomData<i32>,
}

#[no_mangle]
pub extern "C" fn root(
    a: *mut Opaque,
    b: Normal,
    c: NormalWithZST
) { }