|
|
|
|
|
by nicce
699 days ago
|
|
> yes, but there could be a logic error somewhere in safe code that causes an unsafe block to do something it shouldn’t. Sounds like bad design. You can typically limit the use for unsafe for so small area than you can verify the ranges of parameters which will cause memory problems. Check for invalid values and raise panic. Still ”memorysafe”, even if it panics. |
|
Let me emphasize that I am not criticizing Rust here. I am just pointing out an incontrovertible fact about how unsafe blocks in Rust work: memory safety bugs are not guaranteed to be localized to unsafe blocks.