Modern compilers like clang and GCC both have static analysis for some of this. Check out the undefined behavior sanitizer.
The technical reason is that Rust-the-language gives the compiler much more information to work with, and it doesn’t look like it is possible to add this information to the C or C++ languages.