pub fn diag_span_note_once<'a, 'b>(&'a self,
                                       diag_builder: &'b mut DiagnosticBuilder<'a>,
                                       lint: &'static lint::Lint, span: Span, message: &str) {
        match self.opts.error_format {
            // when outputting JSON for tool consumption, the tool might want
            // the duplicates
            config::ErrorOutputType::Json => {
                diag_builder.span_note(span, &message);
            },
            _ => {
                let lint_id = lint::LintId::of(lint);
                let id_span_message = (lint_id, span, message.to_owned());
                let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
                if fresh {
                    diag_builder.span_note(span, &message);
                }
            }
        }
    }
/// Analogous to calling `.span_note` on the given DiagnosticBuilder, but
/// deduplicates on lint ID, span, and message for this `Session` if we're
/// not outputting in JSON mode.
//
// FIXME: if the need arises for one-time diagnostics other than
// `span_note`, we almost certainly want to generalize this
// "check/insert-into the one-time diagnostics map, then set message if
// it's not already there" code to accomodate all of them
Analogous to calling `.span_note` on the given DiagnosticBuilder, but
deduplicates on lint ID, span, and message for this `Session` if we're
not outputting in JSON mode.

if the need arises for one-time diagnostics other than
`span_note`, we almost certainly want to generalize this
"check/insert-into the one-time diagnostics map, then set message if
it's not already there" code to accomodate all of them
Analogous to calling ` . span_note ` on the given DiagnosticBuilder but deduplicates on lint ID span and message for this ` Session ` if we ' re not outputting in JSON mode . if the need arises for one - time diagnostics other than ` span_note ` we almost certainly want to generalize this " check / insert - into the one - time diagnostics map then set message if it ' s not already there " code to accomodate all of them
pub fn diag_span_note_once<'a, 'b>(&'a self,
                                       diag_builder: &'b mut DiagnosticBuilder<'a>,
                                       lint: &'static lint::Lint, span: Span, message: &str) {
        match self.opts.error_format {
            // when outputting JSON for tool consumption, the tool might want
            // the duplicates
            config::ErrorOutputType::Json => {
                diag_builder.span_note(span, &message);
            },
            _ => {
                let lint_id = lint::LintId::of(lint);
                let id_span_message = (lint_id, span, message.to_owned());
                let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
                if fresh {
                    diag_builder.span_note(span, &message);
                }
            }
        }
    }
pub fn diag_span_note_once < ' a , ' b > ( & ' a self , diag_builder : & ' b mut DiagnosticBuilder < ' a > , lint : & ' static lint :: Lint , span : Span , message : & str ) { match self . opts . error_format { // when outputting JSON for tool consumption, the tool might want // the duplicates config :: ErrorOutputType :: Json => { diag_builder . span_note ( span , & message ) ; } , _ => { let lint_id = lint :: LintId :: of ( lint ) ; let id_span_message = ( lint_id , span , message . to_owned ( ) ) ; let fresh = self . one_time_diagnostics . borrow_mut ( ) . insert ( id_span_message ) ; if fresh { diag_builder . span_note ( span , & message ) ; } } } }
Analogous to calling `.span_note` on the given DiagnosticBuilder, but
deduplicates on lint ID, span, and message for this `Session` if we're
not outputting in JSON mode.
Analogous to calling ` . span_note ` on the given DiagnosticBuilder but deduplicates on lint ID span and message for this ` Session ` if we ' re not outputting in JSON mode .
&'a self
diag_builder
&'b mut DiagnosticBuilder<'a>
lint
&'static lint::Lint
span
Span
message
&str
&'a self
diag_builder
&'b mut DiagnosticBuilder<'a>
lint
&'static lint::Lint
span
Span
message
&str