@@ -39,7 +39,7 @@ pub struct DiagnosticBuilder<'a> {
39
39
/// it easy to declare such methods on the builder.
40
40
macro_rules! forward {
41
41
// Forward pattern for &self -> &Self
42
- ( pub fn $n: ident( & self , $( $name: ident: $ty: ty, ) * ) -> & Self ) => {
42
+ ( pub fn $n: ident( & self , $( $name: ident: $ty: ty) , * $ ( , ) * ) -> & Self ) => {
43
43
pub fn $n( & self , $( $name: $ty) ,* ) -> & Self {
44
44
#[ allow( deprecated) ]
45
45
self . diagnostic. $n( $( $name) ,* ) ;
@@ -48,7 +48,7 @@ macro_rules! forward {
48
48
} ;
49
49
50
50
// Forward pattern for &mut self -> &mut Self
51
- ( pub fn $n: ident( & mut self , $( $name: ident: $ty: ty, ) * ) -> & mut Self ) => {
51
+ ( pub fn $n: ident( & mut self , $( $name: ident: $ty: ty) , * $ ( , ) * ) -> & mut Self ) => {
52
52
pub fn $n( & mut self , $( $name: $ty) ,* ) -> & mut Self {
53
53
#[ allow( deprecated) ]
54
54
self . diagnostic. $n( $( $name) ,* ) ;
@@ -58,8 +58,11 @@ macro_rules! forward {
58
58
59
59
// Forward pattern for &mut self -> &mut Self, with S: Into<MultiSpan>
60
60
// type parameter. No obvious way to make this more generic.
61
- ( pub fn $n: ident<S : Into <MultiSpan >>( & mut self , $( $name: ident: $ty: ty, ) * ) -> & mut Self ) => {
62
- pub fn $n<S : Into <MultiSpan >>( & mut self , $( $name: $ty, ) * ) -> & mut Self {
61
+ ( pub fn $n: ident<S : Into <MultiSpan >>(
62
+ & mut self ,
63
+ $( $name: ident: $ty: ty) ,*
64
+ $( , ) * ) -> & mut Self ) => {
65
+ pub fn $n<S : Into <MultiSpan >>( & mut self , $( $name: $ty) ,* ) -> & mut Self {
63
66
#[ allow( deprecated) ]
64
67
self . diagnostic. $n( $( $name) ,* ) ;
65
68
self
@@ -158,14 +161,14 @@ impl<'a> DiagnosticBuilder<'a> {
158
161
found_extra: & dyn fmt:: Display ,
159
162
) -> & mut Self ) ;
160
163
161
- forward ! ( pub fn note( & mut self , msg: & str , ) -> & mut Self ) ;
164
+ forward ! ( pub fn note( & mut self , msg: & str ) -> & mut Self ) ;
162
165
forward ! ( pub fn span_note<S : Into <MultiSpan >>( & mut self ,
163
166
sp: S ,
164
167
msg: & str ,
165
168
) -> & mut Self ) ;
166
- forward ! ( pub fn warn( & mut self , msg: & str , ) -> & mut Self ) ;
167
- forward ! ( pub fn span_warn<S : Into <MultiSpan >>( & mut self , sp: S , msg: & str , ) -> & mut Self ) ;
168
- forward ! ( pub fn help( & mut self , msg: & str , ) -> & mut Self ) ;
169
+ forward ! ( pub fn warn( & mut self , msg: & str ) -> & mut Self ) ;
170
+ forward ! ( pub fn span_warn<S : Into <MultiSpan >>( & mut self , sp: S , msg: & str ) -> & mut Self ) ;
171
+ forward ! ( pub fn help( & mut self , msg: & str ) -> & mut Self ) ;
169
172
forward ! ( pub fn span_help<S : Into <MultiSpan >>( & mut self ,
170
173
sp: S ,
171
174
msg: & str ,
@@ -269,8 +272,8 @@ impl<'a> DiagnosticBuilder<'a> {
269
272
) ;
270
273
self
271
274
}
272
- forward ! ( pub fn set_span<S : Into <MultiSpan >>( & mut self , sp: S , ) -> & mut Self ) ;
273
- forward ! ( pub fn code( & mut self , s: DiagnosticId , ) -> & mut Self ) ;
275
+ forward ! ( pub fn set_span<S : Into <MultiSpan >>( & mut self , sp: S ) -> & mut Self ) ;
276
+ forward ! ( pub fn code( & mut self , s: DiagnosticId ) -> & mut Self ) ;
274
277
275
278
pub fn allow_suggestions ( & mut self , allow : bool ) -> & mut Self {
276
279
self . allow_suggestions = allow;
0 commit comments