Quoting some more relevant stuff from the nomicon. The linked article is short and sweet.
A data race has Undefined Behavior, and is therefore impossible to perform in Safe Rust.
...
However Rust does not prevent general race conditions.
This is pretty fundamentally impossible, and probably honestly undesirable. Your hardware
is racy, your OS is racy, the other programs on your computer are racy, and the world this
all runs in is racy. Any system that could genuinely claim to prevent all race conditions
would be pretty awful to use, if not just incorrect.
You should read [1] to understand how Rust achieves this.
[1]: https://doc.rust-lang.org/nomicon/send-and-sync.html