summaryrefslogtreecommitdiff
path: root/libbindgen/src
diff options
context:
space:
mode:
Diffstat (limited to 'libbindgen/src')
-rw-r--r--libbindgen/src/ir/item.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbindgen/src/ir/item.rs b/libbindgen/src/ir/item.rs
index f4272e2d..74c65083 100644
--- a/libbindgen/src/ir/item.rs
+++ b/libbindgen/src/ir/item.rs
@@ -588,8 +588,13 @@ impl Item {
ctx: &BindgenContext,
for_name_checking: bool)
-> ItemId {
+ let mut targets_seen = AncestorsSeen::new();
let mut item = self;
+
loop {
+ debug_assert!(!targets_seen.contains(&item.id()));
+ targets_seen.insert(item.id());
+
match *item.kind() {
ItemKind::Type(ref ty) => {
match *ty.kind() {