@@ -33,7 +33,11 @@ pub struct DiagnosticBuilder<'a> {
33
33
/// it easy to declare such methods on the builder.
34
34
macro_rules! forward {
35
35
// Forward pattern for &self -> &Self
36
- ( pub fn $n: ident( & self , $( $name: ident: $ty: ty) ,* $( , ) * ) -> & Self ) => {
36
+ (
37
+ $( #[ $attrs: meta] ) *
38
+ pub fn $n: ident( & self , $( $name: ident: $ty: ty) ,* $( , ) * ) -> & Self
39
+ ) => {
40
+ $( #[ $attrs] ) *
37
41
pub fn $n( & self , $( $name: $ty) ,* ) -> & Self {
38
42
#[ allow( deprecated) ]
39
43
self . diagnostic. $n( $( $name) ,* ) ;
@@ -42,7 +46,11 @@ macro_rules! forward {
42
46
} ;
43
47
44
48
// Forward pattern for &mut self -> &mut Self
45
- ( pub fn $n: ident( & mut self , $( $name: ident: $ty: ty) ,* $( , ) * ) -> & mut Self ) => {
49
+ (
50
+ $( #[ $attrs: meta] ) *
51
+ pub fn $n: ident( & mut self , $( $name: ident: $ty: ty) ,* $( , ) * ) -> & mut Self
52
+ ) => {
53
+ $( #[ $attrs] ) *
46
54
pub fn $n( & mut self , $( $name: $ty) ,* ) -> & mut Self {
47
55
#[ allow( deprecated) ]
48
56
self . diagnostic. $n( $( $name) ,* ) ;
@@ -52,10 +60,15 @@ macro_rules! forward {
52
60
53
61
// Forward pattern for &mut self -> &mut Self, with S: Into<MultiSpan>
54
62
// type parameter. No obvious way to make this more generic.
55
- ( pub fn $n: ident<S : Into <MultiSpan >>(
56
- & mut self ,
57
- $( $name: ident: $ty: ty) ,*
58
- $( , ) * ) -> & mut Self ) => {
63
+ (
64
+ $( #[ $attrs: meta] ) *
65
+ pub fn $n: ident<S : Into <MultiSpan >>(
66
+ & mut self ,
67
+ $( $name: ident: $ty: ty) ,*
68
+ $( , ) *
69
+ ) -> & mut Self
70
+ ) => {
71
+ $( #[ $attrs] ) *
59
72
pub fn $n<S : Into <MultiSpan >>( & mut self , $( $name: $ty) ,* ) -> & mut Self {
60
73
#[ allow( deprecated) ]
61
74
self . diagnostic. $n( $( $name) ,* ) ;
@@ -177,34 +190,43 @@ impl<'a> DiagnosticBuilder<'a> {
177
190
msg: & str ,
178
191
) -> & mut Self ) ;
179
192
180
- #[ deprecated( note = "Use `span_suggestion_short_with_applicability`" ) ]
181
- forward ! ( pub fn span_suggestion_short(
182
- & mut self ,
183
- sp: Span ,
184
- msg: & str ,
185
- suggestion: String ,
186
- ) -> & mut Self ) ;
187
-
188
- #[ deprecated( note = "Use `multipart_suggestion_with_applicability`" ) ]
189
- forward ! ( pub fn multipart_suggestion(
190
- & mut self ,
191
- msg: & str ,
192
- suggestion: Vec <( Span , String ) >,
193
- ) -> & mut Self ) ;
194
-
195
- #[ deprecated( note = "Use `span_suggestion_with_applicability`" ) ]
196
- forward ! ( pub fn span_suggestion( & mut self ,
197
- sp: Span ,
198
- msg: & str ,
199
- suggestion: String ,
200
- ) -> & mut Self ) ;
201
-
202
- #[ deprecated( note = "Use `span_suggestions_with_applicability`" ) ]
203
- forward ! ( pub fn span_suggestions( & mut self ,
204
- sp: Span ,
205
- msg: & str ,
206
- suggestions: Vec <String >,
207
- ) -> & mut Self ) ;
193
+ forward ! (
194
+ #[ deprecated( note = "Use `span_suggestion_short_with_applicability`" ) ]
195
+ pub fn span_suggestion_short(
196
+ & mut self ,
197
+ sp: Span ,
198
+ msg: & str ,
199
+ suggestion: String ,
200
+ ) -> & mut Self
201
+ ) ;
202
+
203
+ forward ! (
204
+ #[ deprecated( note = "Use `multipart_suggestion_with_applicability`" ) ]
205
+ pub fn multipart_suggestion(
206
+ & mut self ,
207
+ msg: & str ,
208
+ suggestion: Vec <( Span , String ) >,
209
+ ) -> & mut Self
210
+ ) ;
211
+
212
+ forward ! (
213
+ #[ deprecated( note = "Use `span_suggestion_with_applicability`" ) ]
214
+ pub fn span_suggestion(
215
+ & mut self ,
216
+ sp: Span ,
217
+ msg: & str ,
218
+ suggestion: String ,
219
+ ) -> & mut Self
220
+ ) ;
221
+
222
+ forward ! (
223
+ #[ deprecated( note = "Use `span_suggestions_with_applicability`" ) ]
224
+ pub fn span_suggestions( & mut self ,
225
+ sp: Span ,
226
+ msg: & str ,
227
+ suggestions: Vec <String >,
228
+ ) -> & mut Self
229
+ ) ;
208
230
209
231
pub fn multipart_suggestion_with_applicability ( & mut self ,
210
232
msg : & str ,
0 commit comments