If you want to make C code safe, consider D instead of Rust. D has a much better migration path from C than Rust, as you can do it gradually. Most C can just be included as is. Then you can move individual functions from C to D, with minimal changes - often none at all. That alone gives you array bounds checking, which eliminates the most common cause of memory bugs. You can integrate unit tests that check feature completeness and against regressions. You can gradually start using the optional garbage collector, which eliminates another common type of memory bugs. You can mark portions of code `
@safe` and have the compiler check against unsafe memory operations, thus limiting the cross section that requires extra scrutiny. You can use the new `
@life` for (still limited) pointer lifetime and borrow checking.
And all this can be done as slowly and meticulously as necessary, and without reduction in platform support; D has been integrated in GCC since 2019.
The only thing that D lacks is a code of conduct.