Remove unused diagnostic codes.

Fixes #16449.
auto merge of #17016 : steveklabnik/rust/fix_diagnostic_codes, r=huonw

Fixes #16449.