4 ms·
> wrap everything in unsafe You are expected to follow Rust's memory model in unsafe blocks. Treating unsafe Rust like C is much more dangerous than just using
by zamalek 4y ago
> wrap everything in unsafe
You are expected to follow Rust's memory model in unsafe blocks. Treating unsafe Rust like C is much more dangerous than just using C.
- SpaghettiCthulu 4y agoAssuming you're talking about the aliasing rules, my understanding is that that only applies if you are mixing pointers with references. If you just use `pointer::read` `pointer::write` the aliasing rules don't apply (doesn't mean it's safe, but it won't immediately be undefined behaviour to write to a mutable pointer while another mutable pointer exists, as it would be if you aliased a mutable reference).