Tidying up UI tests [1/N] by reddevilmidzy · Pull Request #140029 · 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.

Discussion: I honestly have no idea what this test is actually trying to exercise. This goes all the way back to 2010 d6b7c96.

I assume this is trying to exercise some short-circuiting behavior of || and && but the test itself makes it hard to tell.

EDIT: the OG version of this Rust was

fn incr(mutable &int x) -> bool { x += 1; check (false); ret false; }

fn main() {

auto x = (1 == 2) || (3 == 3); check (x);

let int y = 10; log x || incr(y); check (y == 10);

if (true && x) { check (true); } else { check (false); }

}

so yeah, I believe this is indeed a || and && short-circuiting test. It has a no-arg closure, presumably because back then there must've been a case where the parser confused || and the no-arg closure form || EXPR or sth.