|
|
|
|
|
by danhau
620 days ago
|
|
Yes, safe Rust is only as safe as the underlying unsafe code is. The power of unsafe is that it‘s opt-in, making the surface area of „dangerous“ code smaller, more visible and easier to reason about. As long as the unsafe parts are safe, you can rest assured that the safe parts will be safe too. |
|
That is not true. It is possible to have two pieces of validated unsafe code that are "safe" in isolation but when you use them in the same codebase, create something unsafe. This is especially true in embedded contexts, where you are often writing code that touches fixed memory offsets, and other shared globals like peripherals.