@@ -55,13 +55,15 @@ pub struct Diagnostic {
55
55
}
56
56
57
57
macro_rules! diagnostic_child_methods {
58
- ( $spanned: ident, $regular: ident, $level: expr) => (
58
+ ( $spanned: ident, $regular: ident, $level: expr) => {
59
59
/// Adds a new child diagnostic message to `self` with the level
60
60
/// identified by this method's name with the given `spans` and
61
61
/// `message`.
62
62
#[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
63
63
pub fn $spanned<S , T >( mut self , spans: S , message: T ) -> Diagnostic
64
- where S : MultiSpan , T : Into <String >
64
+ where
65
+ S : MultiSpan ,
66
+ T : Into <String >,
65
67
{
66
68
self . children. push( Diagnostic :: spanned( spans, $level, message) ) ;
67
69
self
@@ -74,7 +76,7 @@ macro_rules! diagnostic_child_methods {
74
76
self . children. push( Diagnostic :: new( $level, message) ) ;
75
77
self
76
78
}
77
- )
79
+ } ;
78
80
}
79
81
80
82
/// Iterator over the children diagnostics of a `Diagnostic`.
@@ -96,7 +98,7 @@ impl Diagnostic {
96
98
/// Creates a new diagnostic with the given `level` and `message`.
97
99
#[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
98
100
pub fn new < T : Into < String > > ( level : Level , message : T ) -> Diagnostic {
99
- Diagnostic { level : level , message : message. into ( ) , spans : vec ! [ ] , children : vec ! [ ] }
101
+ Diagnostic { level, message : message. into ( ) , spans : vec ! [ ] , children : vec ! [ ] }
100
102
}
101
103
102
104
/// Creates a new diagnostic with the given `level` and `message` pointing to
@@ -107,12 +109,7 @@ impl Diagnostic {
107
109
S : MultiSpan ,
108
110
T : Into < String > ,
109
111
{
110
- Diagnostic {
111
- level : level,
112
- message : message. into ( ) ,
113
- spans : spans. into_spans ( ) ,
114
- children : vec ! [ ] ,
115
- }
112
+ Diagnostic { level, message : message. into ( ) , spans : spans. into_spans ( ) , children : vec ! [ ] }
116
113
}
117
114
118
115
diagnostic_child_methods ! ( span_error, error, Level :: Error ) ;
0 commit comments