Remove all eight DiagnosticBuilder::*_with_code methods.

These all have relatively low use, and can be perfectly emulated with
a simpler construction method combined with `code` or `code_mv`.
This commit is contained in:
Nicholas Nethercote 2024-01-03 21:50:36 +11:00
parent bd4e623485
commit 6682f243dc
14 changed files with 84 additions and 180 deletions

View file

@ -55,11 +55,10 @@ impl<'a> Parser<'a> {
} else if let token::DocComment(comment_kind, attr_style, data) = self.token.kind {
if attr_style != ast::AttrStyle::Outer {
let span = self.token.span;
let mut err = self.dcx().struct_span_err_with_code(
span,
fluent::parse_inner_doc_comment_not_permitted,
error_code!(E0753),
);
let mut err = self
.dcx()
.struct_span_err(span, fluent::parse_inner_doc_comment_not_permitted);
err.code(error_code!(E0753));
if let Some(replacement_span) = self.annotate_following_item_if_applicable(
&mut err,
span,