File: generic_defaults.rs

package info (click to toggle)
rust-cbindgen 0.27.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: ansic: 15; makefile: 11
file content (16 lines) | stat: -rw-r--r-- 289 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[repr(transparent)]
pub struct Foo<T, P = c_void> {
    field: T,
    _phantom: std::marker::PhantomData<P>,
}

#[repr(C)]
pub struct Bar<T, P> {
    f: Foo<T>,
    p: P,
}

pub type Baz<T> = Foo<T>;

#[no_mangle]
pub extern "C" fn foo_root(f: Foo<i16>, b: Bar<i32, u32>, z: Baz<i64>) {}