“Sharing mutable data between tasks is not allowed” is a simplification. No crime meant, it was also used in many introductory materials on Rust and for good reason. But the truth is, Rust just wants to get rid of data races; not sharing anything of the preferred approach, but not the only one. Rust also wants to be a system programming language in the same sense as C and C ++, so it will not be able to completely remove some features or optimize performance. However, in general, shared modified memory is unsafe (data races, etc.), so if you want to, you will have to accept responsibility by wrapping it in blocks unsafe.
, (, ). , - unsafe, (, , "" ), . : Rust. , Mutex , ( ), .