3 ms·
This could actually work fine in Rust, because it has deterministic evaluation ordering for everything (or almost everything, though I can't think of anything t
by eddyb 11y ago
This could actually work fine in Rust, because it has deterministic evaluation ordering for everything (or almost everything, though I can't think of anything that isn't deterministic).
Knowing that `++i` is `{ i += 1; i }`, we have `i += { i += 1; i };` (which should compile already).
The nested assignment can be hoisted to obtain `i += 1; i += i;`.
That means Rust would compile `i += ++i;` as `i = (i + 1) * 2;`.