diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-03 21:50:36 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-08 16:00:34 +1100 |
| commit | 6682f243dcb9babd67525bbf9798dca302f60588 (patch) | |
| tree | b6342f6aeef783fe40c65a6fa2e34ecf53bd11fe /compiler/rustc_parse/src/parser | |
| parent | bd4e623485f383b478fae662a767a3129bb4b989 (diff) | |
| download | rust-6682f243dcb9babd67525bbf9798dca302f60588.tar.gz rust-6682f243dcb9babd67525bbf9798dca302f60588.zip | |
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`.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/attr.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 1f8c368b2a9..cec657f7b67 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -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, |
