Branch coverage is known to support these branching language constructs:
if and while
- Includes
if let and let-chains
- Treats nested
|| and && as separate branches
while desugars to if before MIR building, so we support it as a consequence of supporting if
- Standalone
|| and && expressions
let-else statements
- Match arm guards
- These also desugar to
if expressions before MIR building
- This also means that we naturally support
if let guards
- But their presence makes it more complicated to instrument match arms, as described below
Branch coverage is known to not yet support these branching language constructs:
Relevant PR links:
(Rewritten on 2024-07-11; see edit history for the old text.)
Branch coverage is known to support these branching language constructs:
ifandwhileif letand let-chains||and&&as separate brancheswhiledesugars toifbefore MIR building, so we support it as a consequence of supportingif||and&&expressions||and&&are treated as separate brancheslet-elsestatementsifexpressions before MIR buildingif letguardsBranch coverage is known to not yet support these branching language constructs:
matchexpressions?operator (which conditionally returns)matchexpression, so once we support those, supporting?should mostly be a matter of expansion-span bookkeeping.awaitexpressions (which implicitly “return” when the enclosing future is dropped)?Relevant PR links:
(Rewritten on 2024-07-11; see edit history for the old text.)