3 ms·
unsafe in Rust == telling the compiler I know what I'm doing here, so eff off. Other languages do this too, for instance in Java you can override final with re
by bluejekyll 10y ago
unsafe in Rust == telling the compiler I know what I'm doing here, so eff off.
Other languages do this too, for instance in Java you can override final with reflection. I lost my mind, both good and bad, when I discovered this.
- steveklabnik 10y agoBut only in a controlled way. Unsafe doesn't change the semantics of existing code, it only adds the ability to do a few extra things. So you're still going to get a lot of safety checks, even within an unsafe block. You still have to be careful, but it's not no-holds-barred.
- bluejekyll 10y agoYeah. I've read your chapter on this repeatedly, and then the Rustinomicon, both hugely useful, but so far all I've done is use of for Rust -> C bindings and vice versa. It's taken me a year to feel good about my Rust code, I'm still getting a handle on unsafe though.