From 98eefa7497626eef8c75fc98475cf9c31153eabe Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 2 May 2024 15:22:32 -0700 Subject: [PATCH] Expand ignored.rs test to cover associated items --- tests/rust/ignore.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/rust/ignore.rs b/tests/rust/ignore.rs index 54ade3247..dd6b0b74f 100644 --- a/tests/rust/ignore.rs +++ b/tests/rust/ignore.rs @@ -10,3 +10,38 @@ pub extern "C" fn another_root() {} #[no_mangle] pub extern "C" fn no_ignore_root() {} + +/// cbindgen:ignore +#[repr(C)] +pub struct IgnoredStruct {} + +pub struct IgnoredStructImpl; + +/// cbindgen:ignore +impl IgnoredStructImpl {} + +/// cbindgen:ignore +pub const IGNORED_CONST: u32 = 0; + +pub const NOT_IGNORED_CONST: u32 = 0; + +pub struct StructWithIgnoredImplMembers; + +impl StructWithIgnoredImplMembers { + /// cbindgen:ignore + #[no_mangle] + pub extern "C" fn ignored_associated_method() {} + + #[no_mangle] + pub extern "C" fn no_ignore_associated_method() {} + + /// cbindgen:ignore + pub const IGNORED_INNER_CONST: u32 = 0; + + pub const NOT_IGNORED_INNER_CONST: u32 = 0; +} + +/// cbindgen:ignore +enum IgnoredEnum {} + +enum NotIgnoredEnum {}