Part of #6993. Moved a bunch of uses of Ident to Name
auto merge of #17683 : gereeter/rust/ident-to-name, r=pcwalton

This does a large chunk of #6993. It is based on top of #17654.
Do not accept functions in enum patterns past resolve
Overhaul typechecking of patterns

Instead of checking patterns in a top-down fashion with a known
expected type on entry, this changes makes typeck establish
appropriate constraints between a pattern and the expression
it destructures, and lets inference compute the final types
or produce good error messages if it's impossible.
Update tests with the new error messages