Skip to content

Commit

Permalink
Fix forward! so it doesn't require trailing commas in some cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Jan 3, 2024
1 parent caefa55 commit b4a6239
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_errors/src/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ macro_rules! forward {
// Forward pattern for &mut self -> &mut Self
(
$(#[$attrs:meta])*
pub fn $n:ident(&mut self, $($name:ident: $ty:ty),* $(,)?) -> &mut Self
pub fn $n:ident(&mut self $(, $name:ident: $ty:ty)* $(,)?) -> &mut Self
) => {
$(#[$attrs])*
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
pub fn $n(&mut self $(, $name: $ty)*) -> &mut Self {
self.diagnostic.$n($($name),*);
self
}
Expand Down Expand Up @@ -407,8 +407,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
sp: impl Into<MultiSpan>,
msg: impl Into<SubdiagnosticMessage>,
) -> &mut Self);
forward!(pub fn is_lint(&mut self,) -> &mut Self);
forward!(pub fn disable_suggestions(&mut self,) -> &mut Self);
forward!(pub fn is_lint(&mut self) -> &mut Self);
forward!(pub fn disable_suggestions(&mut self) -> &mut Self);
forward!(pub fn multipart_suggestion(
&mut self,
msg: impl Into<SubdiagnosticMessage>,
Expand Down

0 comments on commit b4a6239

Please sign in to comment.