fn diag_once<'a, 'b>(
        &'a self,
        diag_builder: &'b mut DiagnosticBuilder<'a>,
        method: DiagnosticBuilderMethod,
        msg_id: DiagnosticMessageId,
        message: &str,
        span_maybe: Option<Span>,
    ) {
        let id_span_message = (msg_id, span_maybe, message.to_owned());
        let fresh = self.one_time_diagnostics
            .borrow_mut()
            .insert(id_span_message);
        if fresh {
            match method {
                DiagnosticBuilderMethod::Note => {
                    diag_builder.note(message);
                }
                DiagnosticBuilderMethod::SpanNote => {
                    let span = span_maybe.expect("span_note needs a span");
                    diag_builder.span_note(span, message);
                }
                DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
                    let span = span_maybe.expect("span_suggestion_* needs a span");
                    diag_builder.span_suggestion_with_applicability(
                        span,
                        message,
                        suggestion,
                        Applicability::Unspecified,
                    );
                }
            }
        }
    }
/// Analogous to calling methods on the given `DiagnosticBuilder`, but
/// deduplicates on lint ID, span (if any), and message for this `Session`
Analogous to calling methods on the given `DiagnosticBuilder`, but
deduplicates on lint ID, span (if any), and message for this `Session`
Analogous to calling methods on the given ` DiagnosticBuilder ` but deduplicates on lint ID span ( if any ) and message for this ` Session `
fn diag_once<'a, 'b>(
        &'a self,
        diag_builder: &'b mut DiagnosticBuilder<'a>,
        method: DiagnosticBuilderMethod,
        msg_id: DiagnosticMessageId,
        message: &str,
        span_maybe: Option<Span>,
    ) {
        let id_span_message = (msg_id, span_maybe, message.to_owned());
        let fresh = self.one_time_diagnostics
            .borrow_mut()
            .insert(id_span_message);
        if fresh {
            match method {
                DiagnosticBuilderMethod::Note => {
                    diag_builder.note(message);
                }
                DiagnosticBuilderMethod::SpanNote => {
                    let span = span_maybe.expect("span_note needs a span");
                    diag_builder.span_note(span, message);
                }
                DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
                    let span = span_maybe.expect("span_suggestion_* needs a span");
                    diag_builder.span_suggestion_with_applicability(
                        span,
                        message,
                        suggestion,
                        Applicability::Unspecified,
                    );
                }
            }
        }
    }
fn diag_once < ' a , ' b > ( & ' a self , diag_builder : & ' b mut DiagnosticBuilder < ' a > , method : DiagnosticBuilderMethod , msg_id : DiagnosticMessageId , message : & str , span_maybe : Option < Span > , ) { let id_span_message = ( msg_id , span_maybe , message . to_owned ( ) ) ; let fresh = self . one_time_diagnostics . borrow_mut ( ) . insert ( id_span_message ) ; if fresh { match method { DiagnosticBuilderMethod :: Note => { diag_builder . note ( message ) ; } DiagnosticBuilderMethod :: SpanNote => { let span = span_maybe . expect ( " " ) ; diag_builder . span_note ( span , message ) ; } DiagnosticBuilderMethod :: SpanSuggestion ( suggestion ) => { let span = span_maybe . expect ( " " ) ; diag_builder . span_suggestion_with_applicability ( span , message , suggestion , Applicability :: Unspecified , ) ; } } } }
Analogous to calling methods on the given `DiagnosticBuilder`, but
deduplicates on lint ID, span (if any), and message for this `Session`
Analogous to calling methods on the given ` DiagnosticBuilder ` but deduplicates on lint ID span ( if any ) and message for this ` Session `
&'a self
diag_builder
&'b mut DiagnosticBuilder<'a>
method
DiagnosticBuilderMethod
msg_id
DiagnosticMessageId
message
&str
span_maybe
Option<Span>
&'a self
diag_builder
&'b mut DiagnosticBuilder<'a>
method
DiagnosticBuilderMethod
msg_id
DiagnosticMessageId
message
&str
span_maybe
Option<Span>