mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
433da1fc04
They pass fine.
17 lines
278 B
Rust
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;
|
|
}
|