rustc: catch non-trait methods before typeck.

Closes #3973.
rustc: catch `impl X for Y` where X is not a trait in resolve.
auto merge of #14974 : Ryman/rust/non_trait_method, r=alexcrichton

Closes #3973.