Assign more diagnostic codes
auto merge of #15754 : jakub-/rust/diagnostics, r=alexcrichton