rust/tests/run-make/extern-fn-generic/testcrate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
278 B
Rust
Raw Normal View History

#![crate_type = "lib"]
#[repr(C)]
pub struct TestStruct<T> {
pub x: u8,
2020-09-01 21:12:52 +00:00
pub y: T,
}
2020-09-01 21:12:52 +00:00
pub extern "C" fn foo<T>(ts: TestStruct<T>) -> T {
ts.y
}
2016-12-06 00:31:05 +00:00
#[link(name = "test", kind = "static")]
2020-09-01 21:12:52 +00:00
extern "C" {
pub fn call(c: extern "C" fn(TestStruct<i32>) -> i32) -> i32;
}