box.rs 331 B

12345678910111213141516171819
  1. #[repr(C)]
  2. pub struct MyStruct {
  3. number: Box<i32>,
  4. }
  5. pub struct NotReprC<T> {
  6. inner: T,
  7. }
  8. pub type Foo = NotReprC<Box<i32>>;
  9. #[no_mangle]
  10. pub extern "C" fn root(a: &Foo, with_box: &MyStruct) {}
  11. #[no_mangle]
  12. pub extern "C" fn drop_box(x: Box<i32>) {}
  13. #[no_mangle]
  14. pub extern "C" fn drop_box_opt(x: Option<Box<i32>>) {}