4 ms·
Rust has stricter rules than C++. E.g. global mutable variables are way more dangerous in Rust than in C++ - just creating a reference to it can be immediate u
by panstromek 2y ago
Rust has stricter rules than C++. E.g. global mutable variables are way more dangerous in Rust than in C++ - just creating a reference to it can be immediate undefined behaviour.
- oneshtein 2y agoIn Rust, use UnsafeCell. In C++, multiple references to the same variable may cause «use after free» bug in it destructor.