MCDC Coverage: instrument last boolean RHS operands from condition coverage by RenjiSann · Pull Request #124652 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me some times to understand why this would not create an MCDC record for the first 2 conditions.

Actually, it's just because of operator's priority. The AST looks like this

Therefore, before the change,

This emphasizes another weak point of the previous implementation :

let x = a && (b && ( c && (d && (e))));

This decision wasn't recorded at all by MCDC.