rust/tests/run-make-fulldeps/extern-fn-generic/testcrate.rs
2023-01-11 09:32:08 +00:00

17 lines
278 B
Rust

#![crate_type = "lib"]
#[repr(C)]
pub struct TestStruct<T> {
pub x: u8,
pub y: T,
}
pub extern "C" fn foo<T>(ts: TestStruct<T>) -> T {
ts.y
}
#[link(name = "test", kind = "static")]
extern "C" {
pub fn call(c: extern "C" fn(TestStruct<i32>) -> i32) -> i32;
}