rustc: Introduce a new diagnostic code registry

This provides a way to create stable diagnostic codes, while keeping
the overal burden on compiler writers low, and introducing a way to
incrementally provide extended documentation of diagnostics.