pub fn span_lint_and_note<T: LintContext>(
    cx: &T,
    lint: &'static Lint,
    span: impl Into<MultiSpan>,
    msg: &str,
    note_span: Option<Span>,
    note: &str
Expand description

Like span_lint but with a note section instead of a help message.

The note message is presented separately from the main lint message and is attached to a specific span:

If you change the signature, remember to update the internal lint CollapsibleCalls


error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
  --> $DIR/
10 |     forget(&SomeStruct);
   |     ^^^^^^^^^^^^^^^^^^^
   = note: `-D clippy::forget-ref` implied by `-D warnings`
note: argument has type &SomeStruct
  --> $DIR/
10 |     forget(&SomeStruct);
   |            ^^^^^^^^^^^