So as a bit of background I’m working on a code coverage tool for rust and am currently tackling condition coverage which involves working out if every boolean subcondition has been evaluated as true and false - so for
(A || B) && C. A, B and C have to have been true and false for 100% coverage.
Now in C and C++, the evaluation order of boolean subconditions isn’t standardised and could potentially change given different optimisation flags for the compiler. Which can cause things to go wrong if people have subconditions with side effects. Does rust make any guarantees about execution order? In this example I made in rust playground the first condition is always executed first https://play.rust-lang.org/?gist=1eb61ac64a81eb96a619f4c13915d13b&version=stable I’m just wondering if this is guaranteed?
Thanks for any help, I’m aware this is a bit language lawyery so help is greatly appreciated