Skip to main content

Module diagnostics

Module diagnostics 

Source
Expand description

Clippy wrappers around rustc’s diagnostic functions.

These functions are used by the INTERNAL_METADATA_COLLECTOR lint to collect the corresponding lint applicability. Please make sure that you update the LINT_EMISSION_FUNCTIONS variable in clippy_lints::utils::internal_lints::metadata_collector when a new function is added or renamed.

Thank you! ~The INTERNAL_METADATA_COLLECTOR lint

Re-exportsΒ§

use rustc_errors::Applicability; πŸ”’
use rustc_errors::Diag; πŸ”’
use rustc_errors::DiagCtxtHandle; πŸ”’
use rustc_errors::DiagLocation; πŸ”’
use rustc_errors::DiagMessage; πŸ”’
use rustc_errors::Diagnostic; πŸ”’
use rustc_errors::Level; πŸ”’
use rustc_errors::MultiSpan; πŸ”’
use rustc_errors::SubstitutionPart; πŸ”’
use rustc_errors::Suggestions; πŸ”’
use rustc_hir::HirId; πŸ”’
use rustc_lint::LateContext; πŸ”’
use rustc_lint::Lint; πŸ”’
use rustc_lint::LintContext; πŸ”’
use rustc_span::Span; πŸ”’
use std::env; πŸ”’
use std::env; πŸ”’

FunctionsΒ§

docs_link πŸ”’
span_lint
Emit a basic lint message with a msg and a span.
span_lint_and_help
Same as span_lint but with an extra help message.
span_lint_and_note
Like span_lint but with a note section instead of a help message.
span_lint_and_sugg
Add a span lint with a suggestion on how to fix it.
span_lint_and_then
Like span_lint but allows to add notes, help and suggestions using a closure.
span_lint_hir
Like span_lint, but emits the lint at the node identified by the given HirId.
span_lint_hir_and_then
Like span_lint_and_then, but emits the lint at the node identified by the given HirId.
validate_diag πŸ”’
Makes sure that a diagnostic is well formed.