@@ -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,8 @@ 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 >>( & mut self , $( $name: ident: $ty: ty, ) * ) -> & mut Self ) => {
62
+ pub fn $n<S : Into <MultiSpan >>( & mut self , $( $name: $ty, ) * ) -> & mut Self {
63
63
#[ allow( deprecated) ]
64
64
self . diagnostic. $n( $( $name) ,* ) ;
65
65
self
@@ -147,64 +147,64 @@ impl<'a> DiagnosticBuilder<'a> {
147
147
forward ! ( pub fn note_expected_found( & mut self ,
148
148
label: & dyn fmt:: Display ,
149
149
expected: DiagnosticStyledString ,
150
- found: DiagnosticStyledString )
151
- -> & mut Self ) ;
150
+ found: DiagnosticStyledString ,
151
+ ) -> & mut Self ) ;
152
152
153
153
forward ! ( pub fn note_expected_found_extra( & mut self ,
154
154
label: & dyn fmt:: Display ,
155
155
expected: DiagnosticStyledString ,
156
156
found: DiagnosticStyledString ,
157
157
expected_extra: & dyn fmt:: Display ,
158
- found_extra: & dyn fmt:: Display )
159
- -> & mut Self ) ;
158
+ found_extra: & dyn fmt:: Display ,
159
+ ) -> & mut Self ) ;
160
160
161
- forward ! ( pub fn note( & mut self , msg: & str ) -> & mut Self ) ;
161
+ forward ! ( pub fn note( & mut self , msg: & str , ) -> & mut Self ) ;
162
162
forward ! ( pub fn span_note<S : Into <MultiSpan >>( & mut self ,
163
163
sp: S ,
164
- msg: & str )
165
- -> & 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 ) ;
164
+ msg: & str ,
165
+ ) -> & 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
169
forward ! ( pub fn span_help<S : Into <MultiSpan >>( & mut self ,
170
170
sp: S ,
171
- msg: & str )
172
- -> & mut Self ) ;
171
+ msg: & str ,
172
+ ) -> & mut Self ) ;
173
173
174
174
#[ deprecated( note = "Use `span_suggestion_short_with_applicability`" ) ]
175
175
forward ! ( pub fn span_suggestion_short(
176
176
& mut self ,
177
177
sp: Span ,
178
178
msg: & str ,
179
- suggestion: String )
180
- -> & mut Self ) ;
179
+ suggestion: String ,
180
+ ) -> & mut Self ) ;
181
181
182
182
#[ deprecated( note = "Use `multipart_suggestion_with_applicability`" ) ]
183
183
forward ! ( pub fn multipart_suggestion(
184
184
& mut self ,
185
185
msg: & str ,
186
- suggestion: Vec <( Span , String ) >
186
+ suggestion: Vec <( Span , String ) >,
187
187
) -> & mut Self ) ;
188
188
189
189
#[ deprecated( note = "Use `span_suggestion_with_applicability`" ) ]
190
190
forward ! ( pub fn span_suggestion( & mut self ,
191
191
sp: Span ,
192
192
msg: & str ,
193
- suggestion: String )
194
- -> & mut Self ) ;
193
+ suggestion: String ,
194
+ ) -> & mut Self ) ;
195
195
196
196
#[ deprecated( note = "Use `span_suggestions_with_applicability`" ) ]
197
197
forward ! ( pub fn span_suggestions( & mut self ,
198
198
sp: Span ,
199
199
msg: & str ,
200
- suggestions: Vec <String >)
201
- -> & mut Self ) ;
200
+ suggestions: Vec <String >,
201
+ ) -> & mut Self ) ;
202
202
203
203
pub fn multipart_suggestion_with_applicability ( & mut self ,
204
204
msg : & str ,
205
205
suggestion : Vec < ( Span , String ) > ,
206
- applicability : Applicability )
207
- -> & mut Self {
206
+ applicability : Applicability ,
207
+ ) -> & mut Self {
208
208
if !self . allow_suggestions {
209
209
return self
210
210
}
@@ -269,8 +269,8 @@ impl<'a> DiagnosticBuilder<'a> {
269
269
) ;
270
270
self
271
271
}
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 ) ;
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 ) ;
274
274
275
275
pub fn allow_suggestions ( & mut self , allow : bool ) -> & mut Self {
276
276
self . allow_suggestions = allow;
0 commit comments