Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.”

https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html



You might want to read the page you linked

"you can give up guaranteed safety in exchange for greater performance "




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: