@@ -55,13 +55,15 @@ pub struct Diagnostic {
5555}
5656
5757macro_rules! diagnostic_child_methods {
58- ( $spanned: ident, $regular: ident, $level: expr) => (
58+ ( $spanned: ident, $regular: ident, $level: expr) => {
5959 /// Adds a new child diagnostic message to `self` with the level
6060 /// identified by this method's name with the given `spans` and
6161 /// `message`.
6262 #[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
6363 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 >,
6567 {
6668 self . children. push( Diagnostic :: spanned( spans, $level, message) ) ;
6769 self
@@ -74,7 +76,7 @@ macro_rules! diagnostic_child_methods {
7476 self . children. push( Diagnostic :: new( $level, message) ) ;
7577 self
7678 }
77- )
79+ } ;
7880}
7981
8082/// Iterator over the children diagnostics of a `Diagnostic`.
@@ -96,7 +98,7 @@ impl Diagnostic {
9698 /// Creates a new diagnostic with the given `level` and `message`.
9799 #[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
98100 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 ! [ ] }
100102 }
101103
102104 /// Creates a new diagnostic with the given `level` and `message` pointing to
@@ -107,12 +109,7 @@ impl Diagnostic {
107109 S : MultiSpan ,
108110 T : Into < String > ,
109111 {
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 ! [ ] }
116113 }
117114
118115 diagnostic_child_methods ! ( span_error, error, Level :: Error ) ;
0 commit comments