@@ -30,15 +30,6 @@ struct DiagnosticBuilderInner<'a> {
30
30
allow_suggestions : bool ,
31
31
}
32
32
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
-
42
33
/// In general, the `DiagnosticBuilder` uses deref to allow access to
43
34
/// the fields and methods of the embedded `diagnostic` in a
44
35
/// transparent way. *However,* many of the methods are intended to
@@ -54,11 +45,11 @@ macro_rules! forward {
54
45
pub fn $n: ident( & self , $( $name: ident: $ty: ty) ,* $( , ) ?) -> & Self
55
46
) => {
56
47
$( #[ $attrs] ) *
57
- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
48
+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
58
49
pub fn $n( & self , $( $name: $ty) ,* ) -> & Self {
59
50
self . diagnostic. $n( $( $name) ,* ) ;
60
51
self
61
- } ) ;
52
+ }
62
53
} ;
63
54
64
55
// Forward pattern for &mut self -> &mut Self
@@ -67,11 +58,11 @@ macro_rules! forward {
67
58
pub fn $n: ident( & mut self , $( $name: ident: $ty: ty) ,* $( , ) ?) -> & mut Self
68
59
) => {
69
60
$( #[ $attrs] ) *
70
- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
61
+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
71
62
pub fn $n( & mut self , $( $name: $ty) ,* ) -> & mut Self {
72
63
self . 0 . diagnostic. $n( $( $name) ,* ) ;
73
64
self
74
- } ) ;
65
+ }
75
66
} ;
76
67
77
68
// Forward pattern for &mut self -> &mut Self, with generic parameters.
@@ -84,11 +75,11 @@ macro_rules! forward {
84
75
) -> & mut Self
85
76
) => {
86
77
$( #[ $attrs] ) *
87
- forward_inner_docs! ( concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) =>
78
+ # [ doc = concat!( "See [`Diagnostic::" , stringify!( $n) , "()`]." ) ]
88
79
pub fn $n<$( $generic: $bound) ,* >( & mut self , $( $name: $ty) ,* ) -> & mut Self {
89
80
self . 0 . diagnostic. $n( $( $name) ,* ) ;
90
81
self
91
- } ) ;
82
+ }
92
83
} ;
93
84
}
94
85
0 commit comments