asserted_cast.rs 778 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /// cbindgen:prefix-with-name
  2. #[repr(C, u8)]
  3. pub enum H {
  4. /// cbindgen:variant-mut-cast-attributes=MY_ATTRS
  5. Foo(i16),
  6. /// cbindgen:variant-const-cast-attributes=MY_ATTRS
  7. Bar { x: u8, y: i16 },
  8. /// cbindgen:variant-is-attributes=MY_ATTRS
  9. Baz
  10. }
  11. /// cbindgen:prefix-with-name
  12. #[repr(C, u8, u16)]
  13. pub enum I {
  14. /// cbindgen:variant-constructor-attributes=MY_ATTRS
  15. Foo(i16),
  16. /// cbindgen:eq-attributes=MY_ATTRS
  17. Bar { x: u8, y: i16 },
  18. Baz
  19. }
  20. /// cbindgen:prefix-with-name
  21. #[repr(C, u8)]
  22. pub enum J {
  23. Foo(i16),
  24. Bar { x: u8, y: i16 },
  25. Baz
  26. }
  27. /// cbindgen:prefix-with-name
  28. #[repr(u8)]
  29. pub enum K {
  30. Foo(i16),
  31. Bar { x: u8, y: i16 },
  32. Baz
  33. }
  34. #[no_mangle]
  35. pub extern "C" fn foo(
  36. h: H,
  37. i: I,
  38. j: J,
  39. k: K,
  40. ) {}