3 ms·
Rust is just an aggravating language to use. Might just be a personal inability, but I lack the ability to tolerate arguing with the compiler when I know the co
by LAC-Tech 2y ago
Rust is just an aggravating language to use. Might just be a personal inability, but I lack the ability to tolerate arguing with the compiler when I know the code is correct just because the compiler can't prove it.
That's what unsafe is for. From the rust book:
"Unsafe Rust exists because, by nature, static analysis is conservative. When the compiler tries to determine whether or not code upholds the guarantees, it’s better for it to reject some valid programs than to accept some invalid programs. Although the code might be okay, if the Rust compiler doesn’t have enough information to be confident, it will reject the code. In these cases, you can use unsafe code to tell the compiler, “Trust me, I know what I’m doing.” Be warned, however, that you use unsafe Rust at your own risk: if you use unsafe code incorrectly, problems can occur due to memory unsafety, such as null pointer dereferencing."