From 0c82a32443eff41fbc579d437b7c0e487ca52b20 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 2 May 2024 15:42:54 -0700 Subject: [PATCH] add panic to check whether parser even sees it --- src/bindgen/utilities.rs | 3 +++ tests/rust/ignore.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bindgen/utilities.rs b/src/bindgen/utilities.rs index 0e314b9a8..64cdfb995 100644 --- a/src/bindgen/utilities.rs +++ b/src/bindgen/utilities.rs @@ -100,6 +100,9 @@ fn is_skip_item_attr(attr: &syn::Meta) -> bool { if let syn::Lit::Str(ref content) = name_value.lit { // FIXME(emilio): Maybe should use the general annotation // mechanism, but it seems overkill for this. + if content.value().contains("XXX") { + panic!("*** XXX *** {}", content.value()); + } if content.value().trim() == "cbindgen:ignore" { return true; } diff --git a/tests/rust/ignore.rs b/tests/rust/ignore.rs index dd6b0b74f..21480a2d3 100644 --- a/tests/rust/ignore.rs +++ b/tests/rust/ignore.rs @@ -28,14 +28,14 @@ pub const NOT_IGNORED_CONST: u32 = 0; pub struct StructWithIgnoredImplMembers; impl StructWithIgnoredImplMembers { - /// cbindgen:ignore + /// XXX associated method cbindgen:ignore #[no_mangle] pub extern "C" fn ignored_associated_method() {} #[no_mangle] pub extern "C" fn no_ignore_associated_method() {} - /// cbindgen:ignore + /// XXX associated constant cbindgen:ignore pub const IGNORED_INNER_CONST: u32 = 0; pub const NOT_IGNORED_INNER_CONST: u32 = 0;