From 71b97ac304bba01799fc18d85f34389a50444c27 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 25 Jan 2025 17:00:38 -0800 Subject: [PATCH 1/2] Add Item variant for "kind":"FullComment" --- physx-sys/pxbind/src/consumer.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/physx-sys/pxbind/src/consumer.rs b/physx-sys/pxbind/src/consumer.rs index bf1e767c..2bd00308 100644 --- a/physx-sys/pxbind/src/consumer.rs +++ b/physx-sys/pxbind/src/consumer.rs @@ -133,6 +133,7 @@ pub enum Item { TypedefDecl(Typedef), /// The deprecated declspec has been defined on the item (PX_DEPRECATED) DeprecatedAttr, + FullComment, /// We don't care about other items Other { kind: Option, @@ -392,15 +393,10 @@ impl<'ast> AstConsumer<'ast> { /// Walks the AST of a node and attempts to retrieve a comment for it fn get_comment(node: &Node) -> Option> { - let full_comment = node.inner.iter().find(|inner| { - matches!( - inner.kind, - Item::Other { - kind: Some(clang_ast::Kind::FullComment), - name: _, - } - ) - })?; + let full_comment = node + .inner + .iter() + .find(|inner| matches!(inner.kind, Item::FullComment))?; fn gather<'ast>( node: &'ast Node, From eef86beb1c7206cae28542b60b5e28783bfa8431 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 25 Jan 2025 17:01:03 -0800 Subject: [PATCH 2/2] Disregard unrecognized clang AST node kind contents --- physx-sys/pxbind/src/consumer.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/physx-sys/pxbind/src/consumer.rs b/physx-sys/pxbind/src/consumer.rs index 2bd00308..0dc17a3d 100644 --- a/physx-sys/pxbind/src/consumer.rs +++ b/physx-sys/pxbind/src/consumer.rs @@ -135,10 +135,7 @@ pub enum Item { DeprecatedAttr, FullComment, /// We don't care about other items - Other { - kind: Option, - name: Option, - }, + Other, } impl fmt::Display for Item {