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

From https://github.com/itfanr/rust-doc-en/blob/master/unsafe.md#...

> In both unsafe functions and unsafe blocks, Rust will let you do three things that you normally can not do. Just three. Here they are:

> Access or update a static mutable variable. Dereference a raw pointer. Call unsafe functions. This is the most powerful ability. That’s it. It’s important that unsafe does not, for example, ‘turn off the borrow checker’. Adding unsafe to some random Rust code doesn’t change its semantics, it won’t start accepting anything. But it will let you write things that do break some of the rules.



That doesn't change anything I said. Those unsafe functions include things like casting pointers. There's nothing you can't do through some composition of those 3 things.




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

Search: