We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd9f25e commit 0063bf3Copy full SHA for 0063bf3
src/ir/comp.rs
@@ -625,8 +625,15 @@ impl CompInfo {
625
// StructDecl to note incomplete structs that hasn't been
626
// forward-declared before, see:
627
//
628
+ // Also, clang seems to scope struct definitions inside
629
+ // unions to the whole translation unit. Since those are
630
+ // anonymous, let's just assume that if the cursor we've
631
+ // found is a definition it's a valid inner type.
632
+ //
633
// https://github.com/servo/rust-bindgen/issues/482
- if cur.semantic_parent() != cursor {
634
+ let is_inner_struct = cur.semantic_parent() == cursor ||
635
+ cur.is_definition();
636
+ if !is_inner_struct {
637
return CXChildVisit_Continue;
638
}
639
0 commit comments