Can rustc prove this? [ proposal ]

Heuristics like this exist in some linters.

E.g. people from PVS-Studio C/C++ linter described in one of their (too many) blog posts how they catch mistakes happening in practice due to developers copy-pasting code and forgetting to update the copy-pasted version using any source code information available as input.

Which is very similar to your case:

fn add(a: i64, b: i64) -> i64 {
    a + b
}

fn sub(a: i64, b: i64) -> i64 {
    a + b // Oops, copypasted from add, forgot to update
}

As for machine learning, people likely use it for linting too.
At least I've heard about attempts to do in the Svace Static Analyzer for C/C++/Java used in Samsung.

Now milrope only need to convince clippy maintainers to work on something like this.
Which is unlikely because he seems to be a troll account.