Rollup merge of #58591 - dwijnand:dedup-a-rustdoc-diag-construction, r=GuillaumeGomez
Rollup merge of #58591 - dwijnand:dedup-a-rustdoc-diag-construction, r=GuillaumeGomez

Dedup a rustdoc diagnostic construction

None

graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust