File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,10 @@ pub struct Handler {
244244 continue_after_error : Cell < bool > ,
245245 delayed_span_bug : RefCell < Option < Diagnostic > > ,
246246 tracked_diagnostics : RefCell < Option < Vec < Diagnostic > > > ,
247+
248+ // This set contains the `DiagnosticId` of all emitted diagnostics to avoid
249+ // emitting the same diagnostic with extended help (`--teach`) twice, which
250+ // would be uneccessary repetition.
247251 tracked_diagnostic_codes : RefCell < FxHashSet < DiagnosticId > > ,
248252
249253 // This set contains a hash of every diagnostic that has been emitted by
@@ -577,6 +581,10 @@ impl Handler {
577581 ( ret, diagnostics)
578582 }
579583
584+ /// `true` if a diagnostic with this code has already been emitted in this handler.
585+ ///
586+ /// Used to suppress emitting the same error multiple times with extended explanation when
587+ /// calling `-Zteach`.
580588 pub fn code_emitted ( & self , code : & DiagnosticId ) -> bool {
581589 self . tracked_diagnostic_codes . borrow ( ) . contains ( code)
582590 }
You can’t perform that action at this time.
0 commit comments