Skip to content

Commit 8f33ee4

Browse files
committed
Fix forward! so it doesn't require trailing commas in some cases.
1 parent 53dbc6b commit 8f33ee4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ macro_rules! forward {
207207
// Forward pattern for &mut self -> &mut Self
208208
(
209209
$(#[$attrs:meta])*
210-
pub fn $n:ident(&mut self, $($name:ident: $ty:ty),* $(,)?) -> &mut Self
210+
pub fn $n:ident(&mut self $(, $name:ident: $ty:ty)* $(,)?) -> &mut Self
211211
) => {
212212
$(#[$attrs])*
213213
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
214-
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
214+
pub fn $n(&mut self $(, $name: $ty)*) -> &mut Self {
215215
self.diagnostic.$n($($name),*);
216216
self
217217
}
@@ -407,8 +407,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
407407
sp: impl Into<MultiSpan>,
408408
msg: impl Into<SubdiagnosticMessage>,
409409
) -> &mut Self);
410-
forward!(pub fn is_lint(&mut self,) -> &mut Self);
411-
forward!(pub fn disable_suggestions(&mut self,) -> &mut Self);
410+
forward!(pub fn is_lint(&mut self) -> &mut Self);
411+
forward!(pub fn disable_suggestions(&mut self) -> &mut Self);
412412
forward!(pub fn multipart_suggestion(
413413
&mut self,
414414
msg: impl Into<SubdiagnosticMessage>,

0 commit comments

Comments
 (0)