about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-03 14:38:20 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-03 19:40:43 +1100
commitb4a62399840d61c56081e7378220d65e183a00fb (patch)
treec282e02f62e173f3a5598de4914620173baeb4ea /compiler/rustc_errors
parentcaefa553476c2b9bda30ab89f5882f7a35649572 (diff)
Fix `forward!` so it doesn't require trailing commas in some cases.
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index 24efc871001..e018c14a4a5 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -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
         }
@@ -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>,