|
|
|
|
|
by kerkeslager
806 days ago
|
|
> Also, unsafe is not meant to ease the borrow checker pains, that's like using void* everywhere in C because you don't know how to type a function pointer. Unsafe is meant for places where rust simply doesn't know better, like reading memory mapped registers. Eh, one could argue that some of these "Rust simply doesn't know better" situations are often borrow checker pains. But in general, I'd agree that bypassing the borrow checker doesn't seem to be the point of `unsafe` in my limited experience. But the bigger point I'm trying to make is that there doesn't appear to be any solution to some of the borrow checker issues I've run into. There are things you can do in C, which are strongly related to the reasons I'm using these low-level languages, that appear to be impossible in Rust. Keep in mind the caveat that I'm new to Rust, so there may be some solution I'm just not aware of. |
|