Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions bindgen/ir/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,23 +491,18 @@ where

loop {
// While we have plain old data members, just keep adding them to our
// resulting fields. We introduce a scope here so that we can use
// `raw_fields` again after the `by_ref` iterator adaptor is dropped.
// resulting fields.
while let Some(raw_field) =
raw_fields.next_if(|f| f.bitfield_width().is_none())
{
let raw_fields = raw_fields.by_ref();
while let Some(raw_field) =
raw_fields.next_if(|f| f.bitfield_width().is_none())
{
fields.push(Field::DataMember(raw_field.0));
}
fields.push(Field::DataMember(raw_field.0));
}

let mut bitfields = vec![];

// Now gather all the consecutive bitfields. Only consecutive bitfields
// may potentially share a bitfield allocation unit with each other in
// the Itanium C++ ABI.
let raw_fields = raw_fields.by_ref();
while let Some(raw_field) =
raw_fields.next_if(|f| f.bitfield_width().is_some())
{
Expand Down
4 changes: 2 additions & 2 deletions bindgen/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ impl Item {
}

// Ancestors' ID iter
let mut ids_iter = target
let ids_iter = target
.parent_id()
.ancestors(ctx)
.filter(|id| *id != ctx.root_module())
Expand All @@ -884,7 +884,7 @@ impl Item {

// If target is anonymous we need find its first named ancestor.
if target.is_anon() {
for id in ids_iter.by_ref() {
for id in ids_iter {
ids.push(id);

if !ctx.resolve_item(id).is_anon() {
Expand Down
Loading