A linter can do that.
And yes, just about anything non-lexical lifetimes can do you can do with static analysis. But the set of things you can do with Rust includes things that need explicit lifetime annotations, which C doesn't have.
If you're the only person smart enough to solve the $64B problem so everyone can start writing safe and backwards compatible code in C/C++, please, go right ahead.