by senko · 4y ago · 0 comments
Sadly, that achievement is compromised by having to call into unsafe code.
As long as the content of those blocks has been carefully checked there is no problem with using unsafe.
That's incorrect. The borrow checker performs the same checks inside `unsafe` blocks as everywhere else.
`unsafe` blocks can perhaps best be summarized as areas of code where memory safety rules are relaxed. The borrow checker deals with ownership, and ownership rules are still fully enforced inside `unsafe` constructs.
Why is that? Does this imply that there are certain algorithms you simply can't write (efficiently) when using the borrow-checker? (I don't know Rust btw, but have plans to start learning very soon)