Simplify Pin<T> to T
cbindgen already simplifies `MaybeUninit<T>` and `ManuallyDrop<T>` to `T`. This adds `Pin<T>` as well.
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
ccd1f0e9ec
commit
63c1043dfb
@@ -0,0 +1,8 @@
|
||||
#[repr(C)]
|
||||
struct PinTest {
|
||||
pinned_box: Pin<Box<i32>>,
|
||||
pinned_ref: Pin<&mut i32>
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(s: Pin<&mut i32>, p: PinTest) {}
|
||||
@@ -0,0 +1,21 @@
|
||||
header = """
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Pin = T;
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
[export]
|
||||
exclude = [
|
||||
"Pin",
|
||||
"Box"
|
||||
]
|
||||
Reference in New Issue
Block a user