3 ms·
Code that uses the `unsafe` keyword can be safe, though.
by eminence32 4y ago
Code that uses the `unsafe` keyword can be safe, though.
- 29athrowaway 4y agoYes, but you are on your own, and future maintainers will also be on their own.
- kaba0 4y agoThe exact same way all other parts of the code is. You are also on your own in case of any logic bugs, which may well be likely even worse to debug.
- 29athrowaway 4y agoYes, but an important reason to migrate a solution to Rust are the guarantees that it offers with respect to safety. Those guarantees go away if you use "unsafe". In that case, you may just use C or C++.
- kaba0 4y agoSmall, encapsulated uses of unsafe wrapped in a safe wrapper are entirely different than thousands of lines of unsafe. Also - many of the borrow checker’s guarantees are enforced inside unsafe as well.