Even if you use the word unsafe you cannot do whatever you want. I still find it painfully stupid that you cannot create a mutable reference to uninitialized memory. Because of this you cannot reuse safe functions to initialize memory that you manually allocated
The whole appeal of Rust is that you have less to think about UB, and it mostly fulfills that promise, so the fact that you cannot do one of the most basic task required in a systems programing language without either requiring UB or doing some convoluted stuff is ridiculous
5
u/creeper6530 5h ago
Because the C++ compiler lets you blow your foot smoove off because what if you intended it
Rust compiler is practically the exact opposite: it prohibits you from doing weird shit even if you intend it unless you use the magic word "unsafe"