Re:Go: Redefining For Loop Variable Semantics
by masklinn on Tuesday October 11, 2022 @07:45AM
(#33162150)
> Rust detects the faulty Go cases of course
Yes Rust’s ownership rules make it rather complicated to reproduce the faulty behaviour, as it’s about sharing mutable state which Rust intensely dislikes. You’d need to wilfully share (and update) internally mutable structures (cells, atomics) which is pretty noticeable and not something you do by mistake.
[Edited: I tried to explain what's going on here, but I don't think my explanation was helpful so I've just left the surface]