@@ -33,7 +33,11 @@ pub struct DiagnosticBuilder<'a> {
3333/// it easy to declare such methods on the builder.
3434macro_rules! forward {
3535 // 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] ) *
3741 pub fn $n( & self , $( $name: $ty) ,* ) -> & Self {
3842 #[ allow( deprecated) ]
3943 self . diagnostic. $n( $( $name) ,* ) ;
@@ -42,7 +46,11 @@ macro_rules! forward {
4246 } ;
4347
4448 // 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] ) *
4654 pub fn $n( & mut self , $( $name: $ty) ,* ) -> & mut Self {
4755 #[ allow( deprecated) ]
4856 self . diagnostic. $n( $( $name) ,* ) ;
@@ -52,10 +60,15 @@ macro_rules! forward {
5260
5361 // Forward pattern for &mut self -> &mut Self, with S: Into<MultiSpan>
5462 // 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] ) *
5972 pub fn $n<S : Into <MultiSpan >>( & mut self , $( $name: $ty) ,* ) -> & mut Self {
6073 #[ allow( deprecated) ]
6174 self . diagnostic. $n( $( $name) ,* ) ;
@@ -177,34 +190,43 @@ impl<'a> DiagnosticBuilder<'a> {
177190 msg: & str ,
178191 ) -> & mut Self ) ;
179192
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+ ) ;
208230
209231 pub fn multipart_suggestion_with_applicability ( & mut self ,
210232 msg : & str ,
0 commit comments