Skip to content

Commit e6a9291

Browse files
committed
ir: Fix the assert no danging items traversal to avoid getting hung on a cyclic reference caused by inner_const.hpp.
1 parent 01cb681 commit e6a9291

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libbindgen/src/ir/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,9 @@ impl<'ctx, 'gen> Iterator for AssertNoDanglingItemIter<'ctx, 'gen>
12551255
}
12561256

12571257
for sub_id in sub_types {
1258-
if let Some(value) = self.seen.insert(id, sub_id) {
1259-
self.to_iterate.push_back(value);
1258+
if self.seen.insert(sub_id, id).is_none() {
1259+
// We've never visited this sub item before.
1260+
self.to_iterate.push_back(sub_id);
12601261
}
12611262
}
12621263

0 commit comments

Comments
 (0)