# Function clippy_utils::diagnostics::span_lint_and_then

source ·

    pub fn span_lint_and_then<C, S, F>(
        cx: &C,
        lint: &'static Lint,
        sp: S,
        msg: &str,
        f: F
    )where
        C: LintContext,
        S: Into<MultiSpan>,
        F: FnOnce(&mut Diag<'_, ()>),

Expand description

Like `span_lint` but allows to add notes, help and suggestions using a closure.

If you need to customize your lint output a lot, use this function. If you change the signature, remember to update the internal lint `CollapsibleCalls`