Skip to main content

body_is_straight_line

Function body_is_straight_line 

Source
fn body_is_straight_line(stmts: &[Stmt<'_>]) -> bool
Expand description

Whether every statement of a loop body runs on one straight line: no branch (if/try), no jump (break/continue), no terminal statement, no inline assembly, and no nested loop. Bare blocks are transparent. Any of these would let control skip a removal, skip the cadence step, or leave the loop before a shifted slot is read, none of which this detector tracks, so their presence makes it silent.