Induce an empty loan for the value being matched in match expressions

This is to make sure it hadn't been moved if there are no bindings
in any of the arms.

Fixes #17385.
auto merge of #17413 : jakub-/rust/issue-17385, r=pcwalton

This is to make sure it hadn't been moved if there are no bindings
in any of the arms.

Fixes #17385.
Add detection of unused enum variants
Use more descriptive names in dead code messages
Remove unused enum variants
Remove dead code from librustc