Skip to content

Commit

Permalink
Work around rust-lang/rust#16643
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcallister committed Aug 25, 2014
1 parent ff28f24 commit a5bc24c
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/tree_builder/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,25 @@ impl<'sink, Handle: Clone, Sink: TreeSink<Handle>>
self.frameset_ok = false;

let mut to_close = None;
for node in self.open_elems.iter().rev() {
let nsname = self.sink.elem_name(node.clone());
if can_close(nsname.clone()) {
let (_, name) = nsname;
to_close = Some(name);
break;
}
if extra_special(nsname.clone()) {
break;
// FIXME: using a 'for' loop here ICEs the compiler
// (rust-lang/rust#16643)
{
let mut iter = self.open_elems.iter().rev();
loop {
match iter.next() {
None => break,
Some(node) => {
let nsname = self.sink.elem_name(node.clone());
if can_close(nsname.clone()) {
let (_, name) = nsname;
to_close = Some(name);
break;
}
if extra_special(nsname.clone()) {
break;
}
}
}
}
}

Expand Down

0 comments on commit a5bc24c

Please sign in to comment.