manuallydrop.rs 400 B

12345678910111213141516171819202122
  1. #[repr(C)]
  2. pub struct Point {
  3. x: i32,
  4. y: i32,
  5. }
  6. #[repr(C)]
  7. pub struct MyStruct {
  8. point: std::mem::ManuallyDrop<Point>,
  9. }
  10. pub struct NotReprC<T> {
  11. inner: T,
  12. }
  13. pub type Foo = NotReprC<std::mem::ManuallyDrop<Point>>;
  14. #[no_mangle]
  15. pub extern "C" fn root(a: &Foo, with_manual_drop: &MyStruct) {}
  16. #[no_mangle]
  17. pub extern "C" fn take(with_manual_drop: std::mem::ManuallyDrop<Point>) {}