No, you can't accidentally modify shared state in Rust. Unique ownership requires making sharing explicit, and protections against data races force shared mutable data to explicitly use synchronization primitives like mutexes or atomics. This applies to everything, including closures and async code.
It's not entirely foolproof. You can still have higher-level logic bugs, race conditions when accessing external resources (files, network, database), and deadlocks. However, these tend to be easier to track down and reproduce than heisenbugs caused by data races from unsynchronized memory access.
It's not entirely foolproof. You can still have higher-level logic bugs, race conditions when accessing external resources (files, network, database), and deadlocks. However, these tend to be easier to track down and reproduce than heisenbugs caused by data races from unsynchronized memory access.