@@ -30,15 +30,6 @@ struct DiagnosticBuilderInner<'a> {
3030 allow_suggestions : bool ,
3131}
3232
33- /// This is a helper macro for [`forward!`] that allows automatically adding documentation
34- /// that uses tokens from [`forward!`]'s input.
35- macro_rules! forward_inner_docs {
36- ( $e: expr => $i: item) => {
37- #[ doc = $e]
38- $i
39- } ;
40- }
41-
4233/// In general, the `DiagnosticBuilder` uses deref to allow access to
4334/// the fields and methods of the embedded `diagnostic` in a
4435/// transparent way. *However,* many of the methods are intended to
@@ -54,11 +45,11 @@ macro_rules! forward {
5445 pub fn $n: ident( & self , $( $name: ident: $ty: ty) ,* $( , ) ?) -> & Self
5546 ) => {
5647 $( #[ $attrs] ) *
57- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
48+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
5849 pub fn $n( & self , $( $name: $ty) ,* ) -> & Self {
5950 self . diagnostic. $n( $( $name) ,* ) ;
6051 self
61- } ) ;
52+ }
6253 } ;
6354
6455 // Forward pattern for &mut self -> &mut Self
@@ -67,11 +58,11 @@ macro_rules! forward {
6758 pub fn $n: ident( & mut self , $( $name: ident: $ty: ty) ,* $( , ) ?) -> & mut Self
6859 ) => {
6960 $( #[ $attrs] ) *
70- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
61+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
7162 pub fn $n( & mut self , $( $name: $ty) ,* ) -> & mut Self {
7263 self . 0 . diagnostic. $n( $( $name) ,* ) ;
7364 self
74- } ) ;
65+ }
7566 } ;
7667
7768 // Forward pattern for &mut self -> &mut Self, with generic parameters.
@@ -84,11 +75,11 @@ macro_rules! forward {
8475 ) -> & mut Self
8576 ) => {
8677 $( #[ $attrs] ) *
87- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
78+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
8879 pub fn $n<$( $generic: $bound) ,* >( & mut self , $( $name: $ty) ,* ) -> & mut Self {
8980 self . 0 . diagnostic. $n( $( $name) ,* ) ;
9081 self
91- } ) ;
82+ }
9283 } ;
9384}
9485
0 commit comments