@@ -98,7 +98,7 @@ impl error::Error for ExplicitBug {
9898 }
9999}
100100
101- // Used for emitting structured error messages and other diagnostic information.
101+ /// Used for emitting structured error messages and other diagnostic information.
102102#[ must_use]
103103pub struct DiagnosticBuilder < ' a > {
104104 emitter : & ' a RefCell < Box < Emitter > > ,
@@ -109,7 +109,7 @@ pub struct DiagnosticBuilder<'a> {
109109 children : Vec < SubDiagnostic > ,
110110}
111111
112- // For example a note attached to an error.
112+ /// For example a note attached to an error.
113113struct SubDiagnostic {
114114 level : Level ,
115115 message : String ,
@@ -118,7 +118,7 @@ struct SubDiagnostic {
118118}
119119
120120impl < ' a > DiagnosticBuilder < ' a > {
121- // Emit the diagnostic.
121+ /// Emit the diagnostic.
122122 pub fn emit ( & mut self ) {
123123 if self . cancelled ( ) {
124124 return ;
@@ -132,11 +132,11 @@ impl<'a> DiagnosticBuilder<'a> {
132132 // }
133133 }
134134
135- // Cancel the diagnostic (a structured diagnostic must either be emitted or
136- // cancelled or it will panic when dropped).
137- // BEWARE: if this DiagnosticBuilder is an error, then creating it will
138- // bump the error count on the Handler and cancelling it won't undo that.
139- // If you want to decrement the error count you should use `Handler::cancel`.
135+ /// Cancel the diagnostic (a structured diagnostic must either be emitted or
136+ /// cancelled or it will panic when dropped).
137+ /// BEWARE: if this DiagnosticBuilder is an error, then creating it will
138+ /// bump the error count on the Handler and cancelling it won't undo that.
139+ /// If you want to decrement the error count you should use `Handler::cancel`.
140140 pub fn cancel ( & mut self ) {
141141 self . level = Level :: Cancelled ;
142142 }
@@ -160,12 +160,6 @@ impl<'a> DiagnosticBuilder<'a> {
160160 self . sub ( Level :: Note , msg, Some ( sp) , None ) ;
161161 self
162162 }
163- pub fn note_rfc_1214 ( & mut self , span : Span ) -> & mut DiagnosticBuilder < ' a > {
164- self . span_note ( span,
165- "this warning results from recent bug fixes and clarifications; \
166- it will become a HARD ERROR in the next release. \
167- See RFC 1214 for details.")
168- }
169163 pub fn help ( & mut self , msg : & str ) -> & mut DiagnosticBuilder < ' a > {
170164 self . sub ( Level :: Help , msg, None , None ) ;
171165 self
@@ -220,8 +214,8 @@ impl<'a> DiagnosticBuilder<'a> {
220214 self
221215 }
222216
223- // Convenience function for internal use, clients should use one of the
224- // struct_* methods on Handler.
217+ /// Convenience function for internal use, clients should use one of the
218+ /// struct_* methods on Handler.
225219 fn new ( emitter : & ' a RefCell < Box < Emitter > > ,
226220 level : Level ,
227221 message : & str ) -> DiagnosticBuilder < ' a > {
@@ -235,8 +229,8 @@ impl<'a> DiagnosticBuilder<'a> {
235229 }
236230 }
237231
238- // Convenience function for internal use, clients should use one of the
239- // public methods above.
232+ /// Convenience function for internal use, clients should use one of the
233+ /// public methods above.
240234 fn sub ( & mut self ,
241235 level : Level ,
242236 message : & str ,
@@ -258,8 +252,8 @@ impl<'a> fmt::Debug for DiagnosticBuilder<'a> {
258252 }
259253}
260254
261- // Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or
262- // we emit a bug.
255+ /// Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or
256+ /// we emit a bug.
263257impl < ' a > Drop for DiagnosticBuilder < ' a > {
264258 fn drop ( & mut self ) {
265259 if !self . cancelled ( ) {
0 commit comments